[{"data":1,"prerenderedAt":257},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fv2\u002Fagent\u002Fenvironment":3},{"id":4,"title":5,"body":6,"description":249,"extension":250,"meta":251,"navigation":252,"path":253,"seo":254,"stem":255,"__hash__":256},"docs\u002Fdocs\u002Fv2\u002Fagent\u002Fenvironment.md","Environment & Secrets",{"type":7,"value":8,"toc":243},"minimark",[9,13,25,80,83,88,99,103,110,164,167,171,179,182,217,221,227,230,239],[10,11,5],"h1",{"id":12},"environment-secrets",[14,15,16,17,21,22,24],"p",{},"The ",[18,19,20],"code",{},".env"," file at the agent root is the source of truth for the agent's environment\nvariables. It works like any other project's ",[18,23,20],{}," — no injection system, no side\nchannels, no per-environment re-declaration.",[26,27,32],"pre",{"className":28,"code":29,"language":30,"meta":31,"style":31},"language-bash shiki shiki-themes dark-plus","# my-agent\u002F.env\nGITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx\nLINEAR_API_KEY=lin_api_xxxxxxxxxxxxxxxxxxxx\nDATABASE_URL=postgres:\u002F\u002Flocalhost:5432\u002Fmydb\n","bash","",[18,33,34,43,58,69],{"__ignoreMap":31},[35,36,39],"span",{"class":37,"line":38},"line",1,[35,40,42],{"class":41},"sOLPB","# my-agent\u002F.env\n",[35,44,46,50,54],{"class":37,"line":45},2,[35,47,49],{"class":48},"s3F5K","GITHUB_TOKEN",[35,51,53],{"class":52},"sTNBD","=",[35,55,57],{"class":56},"sKc5r","ghp_xxxxxxxxxxxxxxxxxxxx\n",[35,59,61,64,66],{"class":37,"line":60},3,[35,62,63],{"class":48},"LINEAR_API_KEY",[35,65,53],{"class":52},[35,67,68],{"class":56},"lin_api_xxxxxxxxxxxxxxxxxxxx\n",[35,70,72,75,77],{"class":37,"line":71},4,[35,73,74],{"class":48},"DATABASE_URL",[35,76,53],{"class":52},[35,78,79],{"class":56},"postgres:\u002F\u002Flocalhost:5432\u002Fmydb\n",[14,81,82],{},"Standard dotenv format, parsed by Bun's native loader — quoted values, multiline\nvalues, and comments all work.",[84,85,87],"h2",{"id":86},"giving-the-agent-a-key-is-explicit","Giving the agent a key is explicit",[14,89,90,91,93,94,98],{},"Putting a key in the agent's ",[18,92,20],{}," ",[95,96,97],"em",{},"is"," the act of giving the agent that key. There is\nno other door: the capsule does not inherit your shell environment, and an agent\ninstalled from the registry cannot silently read credentials from your machine. If a\nkey isn't in the agent's environment, the agent doesn't have it.",[84,100,102],{"id":101},"how-the-agent-reads-keys","How the agent reads keys",[14,104,105,106,109],{},"Inside the capsule, the environment is just ",[18,107,108],{},"process.env"," — tools and agent-emitted\ncode read it the way any Node or Bun code would:",[26,111,115],{"className":112,"code":113,"language":114,"meta":31,"style":31},"language-ts shiki shiki-themes dark-plus","\u002F\u002F src\u002Ftools\u002Fgithub.ts\nconst octokit = new Octokit({ auth: process.env.GITHUB_TOKEN })\n","ts",[18,116,117,122],{"__ignoreMap":31},[35,118,119],{"class":37,"line":38},[35,120,121],{"class":41},"\u002F\u002F src\u002Ftools\u002Fgithub.ts\n",[35,123,124,128,132,135,138,142,145,148,151,154,157,159,161],{"class":37,"line":45},[35,125,127],{"class":126},"scz_3","const",[35,129,131],{"class":130},"s9McN"," octokit",[35,133,134],{"class":52}," = ",[35,136,137],{"class":126},"new",[35,139,141],{"class":140},"sCudf"," Octokit",[35,143,144],{"class":52},"({ ",[35,146,147],{"class":48},"auth:",[35,149,150],{"class":48}," process",[35,152,153],{"class":52},".",[35,155,156],{"class":48},"env",[35,158,153],{"class":52},[35,160,49],{"class":130},[35,162,163],{"class":52}," })\n",[14,165,166],{},"Nothing to declare, nothing to wire. The keys you gave the agent are in its\nenvironment; everything else isn't.",[84,168,170],{"id":169},"keys-travel-with-the-agent","Keys travel with the agent",[14,172,16,173,175,176,178],{},[18,174,20],{}," belongs to the agent folder, so it goes where the folder goes. Deploy the\nagent and its keys deploy with it — the agent reads ",[18,177,108],{}," in the cloud exactly\nas it did on your machine. No secrets dashboard, no environment-specific setup.",[14,180,181],{},"Two boundaries hold regardless:",[183,184,185,204],"ul",{},[186,187,188,192,193,195,196,199,200,203],"li",{},[189,190,191],"strong",{},"Never committed"," — ",[18,194,20],{}," is ",[18,197,198],{},".gitignore","d when ",[18,201,202],{},"axon init"," scaffolds the folder",[186,205,206,209,210,212,213,216],{},[189,207,208],{},"Never published"," — publishing an agent or module to the registry always excludes\n",[18,211,20],{},". Your keys ship with ",[95,214,215],{},"your"," deployments, never with shared source.",[84,218,220],{"id":219},"rotating-a-key","Rotating a key",[14,222,223,224,226],{},"Update the value in ",[18,225,20],{}," and save. In local development the capsule hot-reloads and\nfuture tool calls see the new value. For a deployed agent, redeploy.",[228,229],"hr",{},[14,231,232,233,238],{},"Once the agent has a key, ",[234,235,237],"a",{"href":236},"\u002Fdocs\u002Fv2\u002Fagent\u002Fpolicy","Policy"," governs what it can actually\ndo with it — which hosts it can call, which files it can touch.",[240,241,242],"style",{},"html pre.shiki code .sOLPB, html code.shiki .sOLPB{--shiki-default:#6A9955}html pre.shiki code .s3F5K, html code.shiki .s3F5K{--shiki-default:#9CDCFE}html pre.shiki code .sTNBD, html code.shiki .sTNBD{--shiki-default:#D4D4D4}html pre.shiki code .sKc5r, html code.shiki .sKc5r{--shiki-default:#CE9178}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 pre.shiki code .scz_3, html code.shiki .scz_3{--shiki-default:#569CD6}html pre.shiki code .s9McN, html code.shiki .s9McN{--shiki-default:#4FC1FF}html pre.shiki code .sCudf, html code.shiki .sCudf{--shiki-default:#DCDCAA}",{"title":31,"searchDepth":45,"depth":45,"links":244},[245,246,247,248],{"id":86,"depth":45,"text":87},{"id":101,"depth":45,"text":102},{"id":169,"depth":45,"text":170},{"id":219,"depth":45,"text":220},"The .env file at the agent root is the source of truth for the agent's environment\nvariables. It works like any other project's .env — no injection system, no side\nchannels, no per-environment re-declaration.","md",{},true,"\u002Fdocs\u002Fv2\u002Fagent\u002Fenvironment",{"title":5,"description":249},"docs\u002Fv2\u002Fagent\u002Fenvironment","JGVSUCEyrYHQiJMJMzpQLBqfPr3UEOpismSQAHUssZU",1785671806622]