guardry/For AI agents/Codex
Use Guardry Secrets with Codex
Set up Codex with the guardry CLI, the guardry-secrets skill and a scoped agent credential that expires and can be revoked.
Codex can run your code with real API keys without those keys sitting in a prompt or a .env file. You give it an agent credential with a scope, permissions and a lifetime, and every value it reads is recorded before it leaves the vault. There are three things to do: create the credential, run the installer and sign the CLI in.
1. Create an agent credential
Request an invite if you are new, then add the secrets Codex needs.
Open Agent access, choose Connect agent and create a credential for Codex alone. Choose its scope, its permissions and its lifetime: 1 hour or 4 hours for a working session, or 7 days or 30 days. The credential is shown once.
2. Install the CLI and the skill
curl -fsSL https://app.guardry.ai/install.sh | sh
The installer installs the guardry CLI and puts the guardry-secrets skill in the shared agent-skills directory, which Codex recognizes. To install it for Codex explicitly, use either of these:
guardry skill install --agent codex DISABLE_TELEMETRY=1 npx skills add https://app.guardry.ai --skill guardry-secrets --global --agent codex
Start a new agent session so Codex discovers the skill. Installing it does not sign the CLI in or grant a scope.
3. Sign the CLI in
guardry login --profile coding-agent guardry --profile coding-agent whoami
Paste the credential at the hidden prompt, not into the conversation and not as a command argument.
4. Run something
Give Codex an instruction that names the profile and the entry: "Use Guardry profile coding-agent to run this application with API_KEY. Do not print the value."
guardry --profile coding-agent secrets run --secret API_KEY --secret DATABASE_URL -- python agent.py
guardry secrets run starts the program with the named values in its environment. Nothing is written to disk.
5. Optional: connect over MCP
guardry --profile coding-agent mcp config
Add the printed configuration to your MCP client's server settings. It contains an executable path and a profile name, and no credential. See the MCP server page.
What the agent can and cannot do
- Discover. It can search names, descriptions and credential bundles without reading a value.
- Read. It can read secret values if the credential allows it, and only after your approval if you require one.
- Create. It can add new entries if you grant that permission.
- Never. It cannot edit, rotate or delete an existing entry, including one it created. It cannot see members, manage credentials or approve anything.
Variables are visible to every agent credential that covers their environment, without approval, so anything sensitive should be a secret. An agent that can read a secret can copy it.
Questions
Where does Codex find the skill?
In the shared agent-skills directory. The installer puts the guardry-secrets skill there, and Codex recognizes that location. guardry skill install --agent codex installs it explicitly.
Can Codex store a key it creates?
Yes, if its credential may create entries. The value is passed on stdin, as in your-credential-generator | guardry secrets create NEW_API_KEY --stdin, so it is not put in the command line. Codex cannot edit or delete the entry afterwards.
What if Codex exposes a secret by accident?
It can report the leak with guardry secrets report-leak, without copying the value. The dashboard then shows "Rotation required" on that entry until a person resolves it. Guardry does not scan for leaks and does not rotate the key at its provider, so you revoke the old key there and save the new value in the dashboard.