Agents read text that you do not control. Agents also write logs, traces, and transcripts. Any of these can leak.

Cursor recently published a clear report on a security incident. Some stored agent traces contained credentials that were not redacted. An attacker copied the traces. Then the attacker used those credentials to get access to other systems.

This risk applies to every agent platform, including ours. If an agent can read a secret, that secret can leak. Redaction and secret scanning help, but they can miss a value.

Runta uses a different rule: real credentials do not go into the runtime.

Two controls

  1. Secret stubs. The runtime holds only a stub value, runta-secret-stub. The stub is not a key. It does not work anywhere else.
  2. Egress control. All outbound traffic from the runtime goes through the Runta egress gateway. The gateway holds the real key. It adds the key at the edge, only for the hosts and paths that you allow.

An agent, a prompt injection, or a leaked environment dump can get only the stub.

Follow one request

The example below uses an API key for an LLM provider. Select a hop, or use Next hop, to see which key is present at each step.

The real key exists only on the hop between the gateway and the provider. The VM never holds it.

What the agent sees and what the gateway sends

The request is the same at both points. Only one header changes. Use the toggle to compare the two views.

Try to leak the key

Select an attack. Then change the egress policy and look at the result again.

A stolen trace from a Runta runtime contains runta-secret-stub. The stub does not authenticate outside the gateway. The attacker gets nothing that they can use.

Set it up

Store the real key in Runta. Use --prompt so that the key does not go into your shell history.

runta secret set LLM_API_KEY --prompt

Add a secret stub rule for the runtime. The gateway replaces ${credential} with the stored key, only for this host and path.

runta secret rule set demo \
  --host api.llm-provider.example \
  --path '/v1/*' \
  --secret LLM_API_KEY \
  --header Authorization \
  --template 'Bearer ${credential}'

Limit egress to the hosts that the agent needs.

runta egress set demo --mode allowlist --allow api.llm-provider.example

In the runtime, set LLM_API_KEY to runta-secret-stub. The SDK then sends requests as usual. For the built-in OpenAI preset, Runta sets the stub for you.

Know the limits

  • The stub works inside the runtime for requests that match a rule. A hijacked agent can still call the allowed service. Keep each rule to the smallest host and path.
  • An open egress policy lets the agent reach any host. Use an allowlist for agents that read untrusted input.
  • Runta keeps the key out of the VM. Your application must still decide what the agent is allowed to do.

For more detail, read the Secret Stubs and Egress guides.