Keeping secrets out of agent prompts: how Vault and DLP fit together
Originally published on sandscale.dev . An agent that deploys code, queries a database or calls an API needs credentials. The usual shortcuts, a .env file in the repo, a key pasted into the prompt, a token in a shell history, put those credentials in places where they get copied. This post walks through how credentials leak in agent runs, what Sandscale's Vault and DLP each do about it, and which…
How credentials leak in an agent run
A credential can end up in several places during an agent run. It may be pasted into the prompt by a person, or the agent may read a file containing a key and include it in the next model call. If this happens, the credential is copied into the provider's logs and the user's transcripts. The agent can also build tool-call arguments that include the key inline, commit a .env file or a config with a token to the repository, or have a tool print the environment, causing the value to return as context to the model.
Lastly, logs and traces from the user's telemetry also record these details. The expiration of a credential after the initial run is not guaranteed.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.