What is secrets management?

Secrets management for AI agents is the practice of storing API tokens, OAuth credentials, and passwords in encrypted server-side storage and injecting them strictly at the tool-execution boundary. Keeping credentials out of system prompts, model context, chat replies, and traces ensures an agent—or a prompt injection—can never leak them.

By Sacha Arbonel, Founder and CTOLast updated
  • Also called
  • Secrets
  • Credentials

Why does secrets management matter?

If a secret ever enters a model’s prompt or tool output, a confused model or prompt-injected user can print it verbatim into a reply or log. Proper isolation makes credential exfiltration structurally impossible at the model layer.

Agents use tools that need credentials. Those secrets should live on the server and be injected only where a tool needs them, never written into the agent’s instructions, where the model could repeat them.

Secrets should also be removed from replies, logs and traces in case one slips through, and rotated when there is any doubt.

Key characteristics of secrets management

  • Stores credentials encrypted server-side in a vault rather than in prompts or skill files.
  • Injects OAuth tokens or API keys only inside the tool connector making the outbound request.
  • Redacts known secret patterns automatically from model replies, logs, and traces.
  • Scopes connected-account credentials per customer space and supports quick revocation.

Example in practice

How Norilu handles secrets management

Frequently asked questions

Should I ever put an API key inside a system prompt or SKILL.md file?
Never. Anything inside instructions or skill text is visible to the language model and can be echoed into replies, traces, or third-party tool calls.
How does secrets management work for multi-tenant customer agents?
Each customer’s connected-account tokens must be stored and retrieved strictly within that customer’s isolated space so one tenant’s run can never access another tenant’s credentials.

Go deeper