Secrets

Preview

Storage, injection, redaction and rotation.

Secrets never enter model context, traces, artifacts or logs. The agent references a secret by name; the runtime resolves it at the transport layer.

Handling rules#

  1. 1Stored encrypted with envelope encryption and per-workspace keys.
  2. 2Referenced by name in tool definitions — ${secret:inventory_api_key} — never inlined.
  3. 3Injected into the HTTP client, not into the environment where generated code could read it.
  4. 4Redacted from every output surface by pattern and by known-value matching.
  5. 5Rotated on schedule; OAuth credentials refresh automatically.
  6. 6Access is logged with the run, step and tool that used them.
ts
defineTool({
  name: class="tok-str">"inventory.lookup",
  auth: { type: class="tok-str">"bearer", secret: class="tok-str">"inventory_api_key" },   // reference only
  async execute(args, ctx) {
class="tok-com">    // ctx.http already carries the credential; the value is not readable here
    return ctx.http.get(class="tok-str">"/v2/inventory", { query: args });
  }
});

Last updated 2026-09-16