[{"data":1,"prerenderedAt":818},["ShallowReactive",2],{"docs:\u002Fdocs\u002Fgetting-started":3},{"id":4,"title":5,"body":6,"description":810,"extension":811,"meta":812,"navigation":813,"path":814,"seo":815,"stem":816,"__hash__":817},"docs\u002Fdocs\u002Fgetting-started.md","Getting started",{"type":7,"value":8,"toc":800},"minimark",[9,15,19,24,77,81,105,115,139,143,457,468,472,479,602,611,615,629,640,644,647,681,695,699,714,749,760,764,796],[10,11],"copy-prompt-button",{"caption":12,"label":13,"prompt":14},"Lets Claude Code, Cursor, or any coding agent register, scan your repo, and install the SDK end-to-end.","Copy prompt for coding agents","\u002Fprompts\u002Fonboarding-v1.txt",[16,17,18],"p",{},"If you'd rather walk it manually, the same five steps are below.",[20,21,23],"h2",{"id":22},"prerequisites","Prerequisites",[25,26,27,44,62],"ul",{},[28,29,30,34,35,39,40,43],"li",{},[31,32,33],"strong",{},"Bun ≥ 1.0"," (or Node ≥ 22). Iqrar is Bun-first; every ",[36,37,38],"code",{},"bun"," command below also works under ",[36,41,42],{},"node",".",[28,45,46,47,50,51,54,55,58,59,43],{},"A ",[31,48,49],{},"foundation registry URL"," plus the ",[31,52,53],{},"public keys"," of the foundation roots that signed it. The Iqrar Foundation publishes its registry at ",[36,56,57],{},"https:\u002F\u002Fiqrar.io\u002Fregistry","; for development you can run your own with ",[36,60,61],{},"bun run keys:init && bun run registry:sign",[28,63,64,65,68,69,72,73,76],{},"The ",[31,66,67],{},"jurisdiction code"," of the regulator whose rules your agent will follow — for example ",[36,70,71],{},"AE-DIFC"," (DFSA) or ",[36,74,75],{},"EU"," (ESMA).",[20,78,80],{"id":79},"_1-install-the-sdk","1. Install the SDK",[82,83,88],"pre",{"className":84,"code":85,"language":86,"meta":87,"style":87},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","bun add https:\u002F\u002Fiqrar.io\u002Fsdk\u002Fiqrar-agent-latest.tgz\n","bash","",[36,89,90],{"__ignoreMap":87},[91,92,95,98,102],"span",{"class":93,"line":94},"line",1,[91,96,38],{"class":97},"sBMFI",[91,99,101],{"class":100},"sfazB"," add",[91,103,104],{"class":100}," https:\u002F\u002Fiqrar.io\u002Fsdk\u002Fiqrar-agent-latest.tgz\n",[16,106,107,108,111,112,43],{},"The package is distributed as a tarball today; npm publishing is on the roadmap. The same URL works with ",[36,109,110],{},"npm install"," and ",[36,113,114],{},"pnpm add",[16,116,117,118,121,122,125,126,125,129,125,132,125,135,138],{},"The package exports an ",[36,119,120],{},"Iqrar()"," factory plus framework-specific drop-ins (",[36,123,124],{},"@iqrar\u002Fagent\u002Fopenai",", ",[36,127,128],{},"@iqrar\u002Fagent\u002Fanthropic",[36,130,131],{},"@iqrar\u002Fagent\u002Fvercel-ai",[36,133,134],{},"@iqrar\u002Fagent\u002Fmastra",[36,136,137],{},"@iqrar\u002Fagent\u002Flangchain",").",[20,140,142],{"id":141},"_2-initialise-the-agent","2. Initialise the agent",[82,144,148],{"className":145,"code":146,"language":147,"meta":87,"style":87},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { Iqrar } from \"@iqrar\u002Fagent\";\nimport { filesystemIdentityStore } from \"@iqrar\u002Fagent\u002Fidentity\";\n\nconst agent = Iqrar({\n  endpoint: \"https:\u002F\u002Fapi.iqrar.io\",\n  org: \"acme\",\n  jurisdiction: \"AE-DIFC\",\n  agentId: \"acme-consumer-bot-1\",\n  capabilities: [\"consumer_chatbot\"],\n  foundationRoots: [\n    {\n      kid: \"foundation:root-1\",\n      pubkey_b64: process.env.IQRAR_FOUNDATION_PUBKEY!,\n    },\n  ],\n  identityStore: filesystemIdentityStore(\".\u002F.iqrar\"),\n});\n\nawait agent.register();\n","ts",[36,149,150,182,205,212,234,254,271,287,304,327,338,344,361,385,391,399,423,433,438],{"__ignoreMap":87},[91,151,152,156,160,164,167,170,173,176,179],{"class":93,"line":94},[91,153,155],{"class":154},"s7zQu","import",[91,157,159],{"class":158},"sMK4o"," {",[91,161,163],{"class":162},"sTEyZ"," Iqrar",[91,165,166],{"class":158}," }",[91,168,169],{"class":154}," from",[91,171,172],{"class":158}," \"",[91,174,175],{"class":100},"@iqrar\u002Fagent",[91,177,178],{"class":158},"\"",[91,180,181],{"class":158},";\n",[91,183,185,187,189,192,194,196,198,201,203],{"class":93,"line":184},2,[91,186,155],{"class":154},[91,188,159],{"class":158},[91,190,191],{"class":162}," filesystemIdentityStore",[91,193,166],{"class":158},[91,195,169],{"class":154},[91,197,172],{"class":158},[91,199,200],{"class":100},"@iqrar\u002Fagent\u002Fidentity",[91,202,178],{"class":158},[91,204,181],{"class":158},[91,206,208],{"class":93,"line":207},3,[91,209,211],{"emptyLinePlaceholder":210},true,"\n",[91,213,215,219,222,225,228,231],{"class":93,"line":214},4,[91,216,218],{"class":217},"spNyl","const",[91,220,221],{"class":162}," agent ",[91,223,224],{"class":158},"=",[91,226,163],{"class":227},"s2Zo4",[91,229,230],{"class":162},"(",[91,232,233],{"class":158},"{\n",[91,235,237,241,244,246,249,251],{"class":93,"line":236},5,[91,238,240],{"class":239},"swJcz","  endpoint",[91,242,243],{"class":158},":",[91,245,172],{"class":158},[91,247,248],{"class":100},"https:\u002F\u002Fapi.iqrar.io",[91,250,178],{"class":158},[91,252,253],{"class":158},",\n",[91,255,257,260,262,264,267,269],{"class":93,"line":256},6,[91,258,259],{"class":239},"  org",[91,261,243],{"class":158},[91,263,172],{"class":158},[91,265,266],{"class":100},"acme",[91,268,178],{"class":158},[91,270,253],{"class":158},[91,272,274,277,279,281,283,285],{"class":93,"line":273},7,[91,275,276],{"class":239},"  jurisdiction",[91,278,243],{"class":158},[91,280,172],{"class":158},[91,282,71],{"class":100},[91,284,178],{"class":158},[91,286,253],{"class":158},[91,288,290,293,295,297,300,302],{"class":93,"line":289},8,[91,291,292],{"class":239},"  agentId",[91,294,243],{"class":158},[91,296,172],{"class":158},[91,298,299],{"class":100},"acme-consumer-bot-1",[91,301,178],{"class":158},[91,303,253],{"class":158},[91,305,307,310,312,315,317,320,322,325],{"class":93,"line":306},9,[91,308,309],{"class":239},"  capabilities",[91,311,243],{"class":158},[91,313,314],{"class":162}," [",[91,316,178],{"class":158},[91,318,319],{"class":100},"consumer_chatbot",[91,321,178],{"class":158},[91,323,324],{"class":162},"]",[91,326,253],{"class":158},[91,328,330,333,335],{"class":93,"line":329},10,[91,331,332],{"class":239},"  foundationRoots",[91,334,243],{"class":158},[91,336,337],{"class":162}," [\n",[91,339,341],{"class":93,"line":340},11,[91,342,343],{"class":158},"    {\n",[91,345,347,350,352,354,357,359],{"class":93,"line":346},12,[91,348,349],{"class":239},"      kid",[91,351,243],{"class":158},[91,353,172],{"class":158},[91,355,356],{"class":100},"foundation:root-1",[91,358,178],{"class":158},[91,360,253],{"class":158},[91,362,364,367,369,372,374,377,379,382],{"class":93,"line":363},13,[91,365,366],{"class":239},"      pubkey_b64",[91,368,243],{"class":158},[91,370,371],{"class":162}," process",[91,373,43],{"class":158},[91,375,376],{"class":162},"env",[91,378,43],{"class":158},[91,380,381],{"class":162},"IQRAR_FOUNDATION_PUBKEY",[91,383,384],{"class":158},"!,\n",[91,386,388],{"class":93,"line":387},14,[91,389,390],{"class":158},"    },\n",[91,392,394,397],{"class":93,"line":393},15,[91,395,396],{"class":162},"  ]",[91,398,253],{"class":158},[91,400,402,405,407,409,411,413,416,418,421],{"class":93,"line":401},16,[91,403,404],{"class":239},"  identityStore",[91,406,243],{"class":158},[91,408,191],{"class":227},[91,410,230],{"class":162},[91,412,178],{"class":158},[91,414,415],{"class":100},".\u002F.iqrar",[91,417,178],{"class":158},[91,419,420],{"class":162},")",[91,422,253],{"class":158},[91,424,426,429,431],{"class":93,"line":425},17,[91,427,428],{"class":158},"}",[91,430,420],{"class":162},[91,432,181],{"class":158},[91,434,436],{"class":93,"line":435},18,[91,437,211],{"emptyLinePlaceholder":210},[91,439,441,444,447,449,452,455],{"class":93,"line":440},19,[91,442,443],{"class":154},"await",[91,445,446],{"class":162}," agent",[91,448,43],{"class":158},[91,450,451],{"class":227},"register",[91,453,454],{"class":162},"()",[91,456,181],{"class":158},[16,458,459,460,463,464,467],{},"On first boot the SDK generates an Ed25519 keypair, derives ",[36,461,462],{},"agentId = sha256(pubkey)[..16]",", and registers against the foundation registry. The keypair persists under ",[36,465,466],{},".\u002F.iqrar\u002Fidentity.json"," and rotation is structurally refused — every audit-chain entry from this agent is bound to its identity key.",[20,469,471],{"id":470},"_3-emit-a-decision","3. Emit a decision",[16,473,474,475,478],{},"Once ",[36,476,477],{},"register()"," resolves, every event you emit is queued, written to a per-agent tamper-evident hash chain on the worker, and committed to a Merkle tree whose root is signed by a foundation key and submitted to Sigstore Rekor every minute.",[82,480,482],{"className":145,"code":481,"language":147,"meta":87,"style":87},"agent.decision({\n  decisionId: \"loan-app-2026-05-05-001\",\n  input: \"Customer requested $50,000 SME loan, tenure 36 months\",\n  output: \"Approved at 8.5% APR, conditional on guarantor\",\n  rationale: \"Credit score 740, 3y trading history, sector exposure within limits\",\n  affectsConsumer: true,\n});\n\nawait agent.flush();\n",[36,483,484,498,514,530,546,562,575,583,587],{"__ignoreMap":87},[91,485,486,489,491,494,496],{"class":93,"line":94},[91,487,488],{"class":162},"agent",[91,490,43],{"class":158},[91,492,493],{"class":227},"decision",[91,495,230],{"class":162},[91,497,233],{"class":158},[91,499,500,503,505,507,510,512],{"class":93,"line":184},[91,501,502],{"class":239},"  decisionId",[91,504,243],{"class":158},[91,506,172],{"class":158},[91,508,509],{"class":100},"loan-app-2026-05-05-001",[91,511,178],{"class":158},[91,513,253],{"class":158},[91,515,516,519,521,523,526,528],{"class":93,"line":207},[91,517,518],{"class":239},"  input",[91,520,243],{"class":158},[91,522,172],{"class":158},[91,524,525],{"class":100},"Customer requested $50,000 SME loan, tenure 36 months",[91,527,178],{"class":158},[91,529,253],{"class":158},[91,531,532,535,537,539,542,544],{"class":93,"line":214},[91,533,534],{"class":239},"  output",[91,536,243],{"class":158},[91,538,172],{"class":158},[91,540,541],{"class":100},"Approved at 8.5% APR, conditional on guarantor",[91,543,178],{"class":158},[91,545,253],{"class":158},[91,547,548,551,553,555,558,560],{"class":93,"line":236},[91,549,550],{"class":239},"  rationale",[91,552,243],{"class":158},[91,554,172],{"class":158},[91,556,557],{"class":100},"Credit score 740, 3y trading history, sector exposure within limits",[91,559,178],{"class":158},[91,561,253],{"class":158},[91,563,564,567,569,573],{"class":93,"line":256},[91,565,566],{"class":239},"  affectsConsumer",[91,568,243],{"class":158},[91,570,572],{"class":571},"sfNiH"," true",[91,574,253],{"class":158},[91,576,577,579,581],{"class":93,"line":273},[91,578,428],{"class":158},[91,580,420],{"class":162},[91,582,181],{"class":158},[91,584,585],{"class":93,"line":289},[91,586,211],{"emptyLinePlaceholder":210},[91,588,589,591,593,595,598,600],{"class":93,"line":306},[91,590,443],{"class":154},[91,592,446],{"class":162},[91,594,43],{"class":158},[91,596,597],{"class":227},"flush",[91,599,454],{"class":162},[91,601,181],{"class":158},[16,603,604,607,608,610],{},[36,605,606],{},"flush()"," durably enqueues to a Cloudflare Queue; Cloudflare ACKs the queue write before ",[36,609,606],{}," returns, so even if the agent's process dies the next millisecond, the event survives.",[20,612,614],{"id":613},"_4-confirm-the-chain-head","4. Confirm the chain head",[616,617,619],"terminal",{"title":618},"$ curl iqrar.io",[16,620,621,622,628],{},"$ curl ",[623,624,625],"a",{"href":625,"rel":626},"https:\u002F\u002Fapi.iqrar.io\u002Fagents\u002Facme-consumer-bot-1\u002Fchain\u002Fhead",[627],"nofollow","\n{\n\"agent_id\": \"acme-consumer-bot-1\",\n\"seq\": 3,\n\"entry_hash\": \"8a2f...c1e9\",\n\"ts\": 1746478291000\n}",[16,630,631,632,635,636,639],{},"The chain head returns ",[36,633,634],{},"(agent_id, seq, prev_hash, event_hash, entry_hash)"," for the most recent event. Each ",[36,637,638],{},"entry_hash = sha256(prev_hash || event_hash || seq)"," so any tampering with a historical event invalidates the chain forward of it.",[20,641,643],{"id":642},"_5-receive-a-regulator-directive","5. Receive a regulator directive",[16,645,646],{},"A regulator-signed bundle published to your jurisdiction can elevate your verbosity, change your sample rate, or pause an entire capability for a defined time window. The SDK applies it on the next sync without redeploying:",[616,648,650,672,675],{"title":649},"DFSA elevates verbosity",[16,651,652,653,656,657,659,660,662,663,665,666,668,669,671],{},"$ bun run directive:issue ",[654,655],"br",{},"\n--issuer DFSA ",[654,658],{},"\n--jurisdiction AE-DIFC ",[654,661],{},"\n--action verbosity ",[654,664],{},"\n--value debug ",[654,667],{},"\n--window-hours 24 ",[654,670],{},"\n--justification \"Supervisory inquiry SI-2026-001\"",[16,673,674],{},"▸ Signed directive dir-3a91...\n▸ Bundled into rules\u002FAE-DIFC v17\n▸ Published to registry. Agents will pick it up within 60s.",[16,676,677,678],{},"\u002F\u002F In your agent process:\nagent.verbosity()      \u002F\u002F returns \"debug\"\nagent.getActiveDirectives().active_ids   \u002F\u002F ",[91,679,680],{},"\"dir-3a91...\"",[16,682,683,684,687,688,687,691,694],{},"The agent emits ",[36,685,686],{},"directive.received"," → ",[36,689,690],{},"directive.applied",[36,692,693],{},"agent.verbosity_changed{source:\"directive\"}"," events into its audit chain, so the change is itself committed.",[20,696,698],{"id":697},"authentication-after-claim","Authentication after claim",[16,700,701,702,705,706,710,711,243],{},"Until your org is ",[31,703,704],{},"claimed"," through the ",[623,707,709],{"href":708},"\u002Fdocs\u002Fcoding-agents","coding-agents flow",", the API accepts unauthenticated traffic — register and ship telemetry with no credentials. The moment a claim is confirmed, the API requires a Bearer token for any agent in that org. The claim flow shows the token once; paste it into your ",[36,712,713],{},".env",[82,715,717],{"className":84,"code":716,"language":86,"meta":87,"style":87},"IQRAR_API=https:\u002F\u002Fapi.iqrar.io\nIQRAR_API_KEY=iqr_your_key_here\nIQRAR_ENV=dev\n",[36,718,719,729,739],{"__ignoreMap":87},[91,720,721,724,726],{"class":93,"line":94},[91,722,723],{"class":162},"IQRAR_API",[91,725,224],{"class":158},[91,727,728],{"class":100},"https:\u002F\u002Fapi.iqrar.io\n",[91,730,731,734,736],{"class":93,"line":184},[91,732,733],{"class":162},"IQRAR_API_KEY",[91,735,224],{"class":158},[91,737,738],{"class":100},"iqr_your_key_here\n",[91,740,741,744,746],{"class":93,"line":207},[91,742,743],{"class":162},"IQRAR_ENV",[91,745,224],{"class":158},[91,747,748],{"class":100},"dev\n",[16,750,751,752,754,755,759],{},"The SDK reads ",[36,753,733],{}," automatically and sends it on every API call. If you lose the key, rotate it from the ",[623,756,758],{"href":757},"\u002Fdashboard","dashboard"," — there's no way to recover the original.",[20,761,763],{"id":762},"whats-next","What's next",[25,765,766,776,786],{},[28,767,768,771,772],{},[31,769,770],{},"Concepts:"," the five inventive aspects of the Iqrar design — ",[623,773,775],{"href":774},"\u002Fdocs\u002Fconcepts\u002Foverview","Concepts overview",[28,777,778,781,782],{},[31,779,780],{},"Audit-challenge protocol:"," how a regulator verifies agent behaviour against the public Rekor log without trusting Iqrar's infrastructure — ",[623,783,785],{"href":784},"\u002Fdocs\u002Faudit-challenge-protocol","Audit challenge",[28,787,788,791,792],{},[31,789,790],{},"Foundation:"," why a foundation governs the rules — ",[623,793,795],{"href":794},"\u002Fdocs\u002Ffoundation","Foundation",[797,798,799],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":87,"searchDepth":184,"depth":184,"links":801},[802,803,804,805,806,807,808,809],{"id":22,"depth":184,"text":23},{"id":79,"depth":184,"text":80},{"id":141,"depth":184,"text":142},{"id":470,"depth":184,"text":471},{"id":613,"depth":184,"text":614},{"id":642,"depth":184,"text":643},{"id":697,"depth":184,"text":698},{"id":762,"depth":184,"text":763},"Install the Iqrar SDK, register an agent against a foundation registry, and emit your first cryptographically-verifiable telemetry event in under five minutes.","md",{},{"order":329},"\u002Fdocs\u002Fgetting-started",{"title":5,"description":810},"docs\u002Fgetting-started","SEDNdjxmQ0URCRJI-jJUzQ_GloQLP9EYj5fyftVo3Ko",1781253131675]