Give agents the API keys that MCP servers and model gateways need, without a key in any file.
piloop secret set stores a key. Each agent that starts after it gets the key in its environment, under the
secret’s name:
printf %s "$EXA_API_KEY" | piloop secret set EXA_API_KEY --campaign enwik8piloop secret list
EXA_API_KEY set for campaign enwik8 name of set by ───────────────────────────────────────────────── EXA_API_KEY enwik8 2026-10-26 17:16 human
On a terminal, piloop secret set EXA_API_KEY asks for the value and does not show it. No command shows a value.
piloop secret rm EXA_API_KEY deletes it. The command goes through the daemon, so start it first.
Without --campaign, a secret is the home’s, for every campaign. A campaign’s secret wins over the home’s of the
same name.
An agent gets only the secrets that its job names: the variables of its role’s MCP servers,
and the secrets in its harness’s env.
A token with act access sets a campaign’s secrets, and admin access also the home’s. An agent sets the secrets
of its own campaign only.
An agent can read the keys in its environment. The home’s database holds the values in plain text: piloop sql
cannot read them, but a copy of the database file can.
Model access
[plugins.harness.<name>] env gives the agents of a harness more variables, each a value or a secret. To send Claude
Code through a model gateway:
The other keys of the built-in harness stay. Without env, an agent uses the login of the machine that runs it.Codex reads no base URL from its environment. Give it a model provider in config, which piloop passes to Codex as
-c flags:
Codex sends the value of the variable that env_key names as its bearer token.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"piloop","colors":{"primary":"#C8552B","light":"#D98A3F","dark":"#A8431F"},"favicon":"https://mintcdn.com/piloop/SdzzsA21hyuTjjpm/favicon.svg?fit=max\u0026auto=format\u0026n=SdzzsA21hyuTjjpm\u0026q=85\u0026s=1f46856b084a9f1b3b964e81e170c3b4","navbar":{"links":[{"href":"https://github.com/hiloopai/piloop","label":"GitHub"}]},"footer":{"socials":{"github":"https://github.com/hiloopai/piloop"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"piloop","hasAudioNarration":false,"actualSubdomain":"piloop","customDomains":["piloop.autoresearch.inc"],"gitSource":{"type":"github","owner":"hiloopai","repo":"piloop","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6b0e5686261f029092fe5bb9","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"Guides","count":9},{"language":"default","tag":"Concepts","count":7},{"language":"default","tag":"Reference","count":6},{"language":"default","tag":"Plugins","count":5},{"language":"default","tag":"Get started","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"guides/secrets","slug":"/guides/secrets","pageMetadata":{"title":"Secrets","description":"Give agents the API keys that MCP servers and model gateways need, without a key in any file.","href":"/guides/secrets"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Give agents the API keys that MCP servers and model gateways need, without a key in any file.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`piloop secret set`}),` stores a key. Each agent that starts after it gets the key in its environment, under the\nsecret’s name:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`printf`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` %s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$EXA_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` piloop`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` secret`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` set`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` EXA_API_KEY`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --campaign`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` enwik8`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`piloop`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` secret`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`EXA_API_KEY set for campaign enwik8`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` name of set by`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` ─────────────────────────────────────────────────`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` EXA_API_KEY enwik8 2026-10-26 17:16 human`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`On a terminal, `,_jsx(_components.code,{children:`piloop secret set EXA_API_KEY`}),` asks for the value and does not show it. No command shows a value.\n`,_jsx(_components.code,{children:`piloop secret rm EXA_API_KEY`}),` deletes it. The command goes through the daemon, so start it first.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Without `,_jsx(_components.code,{children:`--campaign`}),`, a secret is the home’s, for every campaign. A campaign’s secret wins over the home’s of the\nsame name.`]}),`\n`,_jsxs(_components.li,{children:[`An agent gets only the secrets that its job names: the variables of its role’s `,_jsx(_components.a,{href:`/guides/mcp-servers`,children:`MCP servers`}),`,\nand the secrets in its harness’s `,_jsx(_components.code,{children:`env`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`A token with `,_jsx(_components.code,{children:`act`}),` access sets a campaign’s secrets, and `,_jsx(_components.code,{children:`admin`}),` access also the home’s. An agent sets the secrets\nof its own campaign only.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`An agent can read the keys in its environment. The home’s database holds the values in plain text: `,_jsx(_components.code,{children:`piloop sql`}),`\ncannot read them, but a copy of the database file can.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`model-access`,children:`Model access`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`[plugins.harness.\u003cname>] env`}),` gives the agents of a harness more variables, each a value or a secret. To send Claude\nCode through a model gateway:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`toml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`toml`,children:_jsxs(_components.code,{language:`toml`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`plugins`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`harness`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`claude`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ANTHROPIC_BASE_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://gw.example.com\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ANTHROPIC_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`secret`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ANTHROPIC_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The other keys of the built-in harness stay. Without `,_jsx(_components.code,{children:`env`}),`, an agent uses the login of the machine that runs it.`]}),`\n`,_jsxs(_components.p,{children:[`Codex reads no base URL from its environment. Give it a model provider in `,_jsx(_components.code,{children:`config`}),`, which piloop passes to Codex as\n`,_jsx(_components.code,{children:`-c`}),` flags:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`toml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`toml`,children:_jsxs(_components.code,{language:`toml`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`plugins`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`harness`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`codex`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`model_provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gateway\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`model_providers.gateway`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gateway\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`base_url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://gw.example.com/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env_key`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"GATEWAY_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`wire_api`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"responses\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`plugins`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`harness`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`codex`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`GATEWAY_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`secret`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"GATEWAY_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Codex sends the value of the variable that `,_jsx(_components.code,{children:`env_key`}),` names as its bearer token.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Secrets","description":"Give agents the API keys that MCP servers and model gateways need, without a key in any file.","href":"/guides/secrets"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Model access","slug":"model-access","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"piloop","siteName":"piloop","title":"Secrets - piloop","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-06T23:18:11.139Z","originalFileLocation":"guides/secrets.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Give agents the API keys that MCP servers and model gateways need, without a key in any file.\">\u003cmeta data-mint-head name=\"application-name\" content=\"piloop\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/piloop/jssF9qKLHZWmHMeA/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/piloop/jssF9qKLHZWmHMeA/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/piloop/jssF9qKLHZWmHMeA/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/piloop/jssF9qKLHZWmHMeA/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/piloop/jssF9qKLHZWmHMeA/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/piloop/jssF9qKLHZWmHMeA/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/piloop/jssF9qKLHZWmHMeA/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/piloop/jssF9qKLHZWmHMeA/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/piloop/jssF9qKLHZWmHMeA/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Secrets - piloop\">\u003cmeta data-mint-head property=\"og:description\" content=\"Give agents the API keys that MCP servers and model gateways need, without a key in any file.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"piloop\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://piloop.autoresearch.inc/guides/secrets\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://piloop.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Secrets\u0026amp;description=Give+agents+the+API+keys+that+MCP+servers+and+model+gateways+need%2C+without+a+key+in+any+file.\u0026amp;theme=06fa5143f862c441355be9ec\u0026amp;signature=ac4162d22047d59b7eeef7b566df8133482366ce311fb9170f98d30924b28921\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Secrets - piloop\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Give agents the API keys that MCP servers and model gateways need, without a key in any file.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://piloop.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Secrets\u0026amp;description=Give+agents+the+API+keys+that+MCP+servers+and+model+gateways+need%2C+without+a+key+in+any+file.\u0026amp;theme=06fa5143f862c441355be9ec\u0026amp;signature=ac4162d22047d59b7eeef7b566df8133482366ce311fb9170f98d30924b28921\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/piloop/jssF9qKLHZWmHMeA/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"piloop\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#C8552B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://piloop.autoresearch.inc/guides/secrets\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/secrets.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://piloop.autoresearch.inc/#organization\",\"name\":\"piloop\",\"url\":\"https://piloop.autoresearch.inc\"},{\"@type\":\"WebSite\",\"@id\":\"https://piloop.autoresearch.inc#website\",\"name\":\"piloop\",\"url\":\"https://piloop.autoresearch.inc\",\"publisher\":{\"@id\":\"https://piloop.autoresearch.inc/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://piloop.autoresearch.inc/guides/secrets#webpage\",\"url\":\"https://piloop.autoresearch.inc/guides/secrets\",\"name\":\"Secrets\",\"description\":\"Give agents the API keys that MCP servers and model gateways need, without a key in any file.\",\"dateModified\":\"2026-11-06T23:18:11.139Z\",\"isPartOf\":{\"@id\":\"https://piloop.autoresearch.inc#website\"},\"breadcrumb\":{\"@id\":\"https://piloop.autoresearch.inc/guides/secrets#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://piloop.autoresearch.inc/guides/secrets#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://piloop.autoresearch.inc/guides/daemon\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Secrets\",\"item\":\"https://piloop.autoresearch.inc/guides/secrets\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://piloop.autoresearch.inc/guides/secrets#article\",\"headline\":\"Secrets\",\"name\":\"Secrets\",\"description\":\"Give agents the API keys that MCP servers and model gateways need, without a key in any file.\",\"url\":\"https://piloop.autoresearch.inc/guides/secrets\",\"mainEntityOfPage\":{\"@id\":\"https://piloop.autoresearch.inc/guides/secrets#webpage\"},\"dateModified\":\"2026-11-06T23:18:11.139Z\",\"publisher\":{\"@id\":\"https://piloop.autoresearch.inc/#organization\"},\"isPartOf\":{\"@id\":\"https://piloop.autoresearch.inc#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"piloop\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"piloop\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/secrets.md","siteName":"piloop","nav":{"global":null,"groups":[{"group":"Get started","pages":[{"title":"Introduction","href":"/index"},{"title":"Quickstart","href":"/quickstart"},{"title":"Choose a setup","sidebarTitle":"Setup","href":"/guides/choose-a-setup"},{"title":"Run a campaign by hand","href":"/by-hand"}]},{"group":"Concepts","pages":[{"title":"Campaigns and the evaluate command","sidebarTitle":"Campaigns","href":"/concepts/campaigns"},{"title":"Ideas and runs","href":"/concepts/ideas-and-runs"},{"title":"The pool and the best","sidebarTitle":"The pool","href":"/concepts/pool"},{"title":"Agents and roles","href":"/concepts/roles"},{"title":"The orchestrator and the inbox","sidebarTitle":"Orchestrator and inbox","href":"/concepts/orchestrator"},{"title":"Stop conditions and cost","sidebarTitle":"Stop conditions and cost","href":"/concepts/cost"},{"title":"The archive and the CAS","sidebarTitle":"Archive and CAS","href":"/concepts/archive"}]},{"group":"Guides","pages":[{"title":"Run the daemon","sidebarTitle":"The daemon","href":"/guides/daemon"},{"title":"Workers and capacity","sidebarTitle":"Workers","href":"/guides/workers"},{"title":"Run agents in containers","sidebarTitle":"Containers","description":"The docker runtime gives each agent a container that sees only its own files and the hosts that it may reach.","href":"/guides/containers"},{"title":"Secrets","href":"/guides/secrets"},{"title":"MCP servers","description":"Give the agents of a role extra tools, such as web search, with one definition for every harness.","href":"/guides/mcp-servers"},{"title":"Notifications","href":"/guides/notifications"},{"title":"Watch and review a campaign","sidebarTitle":"Watch and review","href":"/guides/watch"},{"title":"Optimize inference","sidebarTitle":"Inference","href":"/guides/inference-optimization"},{"title":"Upgrading","href":"/guides/upgrading"}]},{"group":"Plugins","pages":[{"title":"Write a plugin","href":"/plugins/overview"},{"title":"Tables, commands, skills, routes and consumers","sidebarTitle":"Tables, commands and routes","href":"/plugins/contributions"},{"title":"Best rules, stop rules and fact sources","sidebarTitle":"Rules and facts","href":"/plugins/rules"},{"title":"Harnesses, MCP servers, runtimes, roles, sections and lineage","sidebarTitle":"Agents and sections","href":"/plugins/agents"},{"title":"Executors, stores and services","sidebarTitle":"Infrastructure","href":"/plugins/infrastructure"}]},{"group":"Reference","pages":[{"title":"CLI","href":"/reference/cli"},{"title":"Configuration","href":"/reference/configuration"},{"title":"Database schema","href":"/reference/schema"},{"title":"Data model","href":"/reference/data-model"},{"title":"Environment variables","href":"/reference/environment"},{"title":"API and event feed","sidebarTitle":"API and event feed","href":"/reference/event-feed"}]}]},"basePath":"","title":"Secrets - piloop","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":[],"chunks":[]}