A question on r/ClaudeCode this week, asked plainly: how do you run an agent that needs secrets — a GitHub token, log access through MCP, credentials inside nested test containers — without the agent ever seeing them?
It's the right question, because the default answer is terrible. The default is: paste the key into the environment, the config, or the prompt — and from that moment the secret lives everywhere the agent's words live. In its logs. In its transcripts. In whatever it pastes into the next tool.
An agent that has read a secret can repeat a secret. To a log file, to a website, to a commit message. Not out of malice — out of autocomplete.
Use without sight
The working pattern, in plain terms:
A broker holds the secret. The agent asks the broker to do the thing — call this API, open this connection. The broker injects the credential on its side of the wall. The agent gets the result, never the key.
Minted per task, dead after it. Short-lived tokens scoped to one job. A leaked one is a small, expiring problem — not the master key to the building.
Redaction on the way out. Anything the agent prints passes a scrubber that knows the shapes of your secrets. Belt and suspenders — because output has a way of quoting input.
The vault is not a sandbox. A secrets tool that redacts output is a seatbelt, not a fence. It doesn't stop the agent using a credential wrongly — it stops the credential travelling. You still need the fence: scoped tools, approvals for writes.
My agents work the 3AM shift so no human has to. They work with keys they can use and cannot describe — which means their diaries stay boring, even when someone else reads them.
If your agent printed everything it knows right now, what would come out?
Disclaimer
This post describes my personal experience with my own systems and accounts, in my own words. It is a first-person account of what I observed and what I do in my own work — not a statement of any company’s intentions, policies, or internal decisions. Where I do not know something, the post says so.
I am not affiliated with, endorsed by, or speaking for any company, product, or vendor named in this post. All product and company names are trademarks of their respective owners and are mentioned only to describe the experience accurately.
Any error messages, documentation excerpts, or figures quoted here are reproduced from my own records or from the public sources linked in the post, believed accurate at the time of writing. Product behavior changes over time; verify against current official documentation before relying on any detail.
Nothing in this post is professional, financial, legal, or security advice for your specific situation. Examples are illustrative — validate in your own environment before running anything in production.
Corrections are welcome. If any company named here publishes an official statement, or if any detail is wrong, I will update this post and note the correction. The goal is an accurate public record, not a verdict.
© 2026 Honey Kiran. All rights reserved.
Honey Kiran · DevOps & Platform Engineering
AI agents transforming DevOps, infra, platform, security & SRE. The shift nobody works anymore: deep dives, 3AM Files, and OpsBites.
Examples are illustrative — validate in your own environment before running in production.

Top comments (0)