safekeys/output-control [built]
Output control for model-facing resolution: the sidecar redacts the resolved value (raw, base64, base64url, hex, percent, JSON-escaped, and split-across-chunks forms, including substrings of 8+ characters) out of any stdout/stderr it relays, replacing matches with [REDACTED:safekeys]; resolve_for_tool defaults to exit code plus redacted, size-capped output; policy rules can bind allowed commands (executable path plus argument patterns) per object and scope, and MCP-initiated resolves are denied unless an allowlist exists; CLI and SDK resolves fall back to a documented backstop denylist for known dumpers. Redaction lives in the sidecar, never the MCP server.
Status: built
Why this exists
resolve_for_tool runs a model-chosen command and relays its output to the model, so a prompt-injected agent can run printenv, env, cat, or echo and read the secret straight back — today nothing redacts output and policy cannot restrict which commands run. Closing this needs defence in depth at the trust boundary, not in the agent's process: redact the value out of anything the sidecar relays, make status-only output the default, and let policy bind which commands may run.
Design decisions
redaction-in-sidecar-not-mcp [accepted]
Decision: Implement redaction in the sidecar's relay path rather than in the MCP server.
Rationale: The sidecar is the trust boundary every client shares. Redacting in the agent-adjacent MCP server would trust the least privileged component to protect the most sensitive data, and any other socket client (CLI, SDKs) would silently miss the protection.
Date: 2026-09-28
mcp-deny-by-default [accepted]
Decision: MCP-initiated resolves require an explicit command allowlist; without one they are refused regardless of the denylist.
Rationale: The MCP caller is model-chosen by construction — the model authors the command — so the default posture must be refuse-with-guidance rather than best-effort filtering. The clear error converts a denial into a one-step operator fix. CLI and SDK resolves are operator-initiated, where the backstop denylist plus redaction is a defensible default.
Consequences: The resolve request gains an origin field (mcp, cli, sdk). Operators must author allowlists for MCP use; the error message makes that actionable.
Date: 2026-09-28
denylist-is-a-backstop [accepted]
Decision: Keep a denylist of known dumpers for CLI and SDK resolves and document it as a backstop, not the control.
Rationale: The allowlist and redaction are the controls. A denylist cannot enumerate every exfiltration vector, and pretending otherwise would overstate the guarantee. The list is still worth having because it catches the lazy injection for free.
Date: 2026-09-28
commands-in-policy-not-claims [accepted]
Decision: Command restrictions live in policy rules, not token claims.
Rationale: The token claims schema is frozen by conformance vectors and adding command syntax to every token would bloat the artefact agents reason about. Policy rules are operator-authored and changeable without touching the wire format.
Date: 2026-09-28
substrings-not-whole-value [accepted]
Decision: Redact substrings of the secret of 8+ characters (or the full value when shorter), in every listed encoding.
Rationale: A prompt-injected command rarely prints the whole value — cut, head -c, or a partial log line leaks a prefix or a slice. Short fragments below 8 characters would produce false positives on ordinary output, so the floor is a deliberate trade of completeness for practicality.
Date: 2026-09-28
How it works
Redact the resolved value out of relayed output (redact-relayed-output)
- Receive — The sidecar resolves a token and injects the value into a command.
- Validate — Before returning captured stdout/stderr, the sidecar scans for the value and any substring of it of 8+ characters (or the full value when shorter) in raw, base64, base64url, hex, percent-encoded, and JSON-escaped form, split across adjacent lines or chunks included.
- Send — Each match is replaced with [REDACTED:safekeys] before the output leaves the sidecar.
- Record — A redaction event is appended to the audit log carrying counts, not values.
Return status-only output by default (status-only-by-default)
- Receive — An MCP resolve_for_tool call completes.
- Observe — The tool result carries the exit code and redacted output capped at 4 KiB.
- Validate — Uncapped output is returned only when policy explicitly allows it for that token's scope and object.
- Observe — The tool description tells the model output is redacted and size-capped.
Require an allowlist for MCP-initiated resolves (command-allowlist)
- Setup — An operator rule binds allowed command specifications — executable path plus argument patterns — to an object and scope.
- Validate — At resolve, a request carrying an MCP origin must match a specification; when no allowlist governs the token and scope, MCP-initiated resolves are refused with an error telling the operator to add one.
- Record — The denial names the rule and carries no value.
Refuse known dumpers for CLI and SDK resolves without an allowlist (backstop-denylist)
- Receive — A CLI or SDK resolve arrives with no command allowlist governing it.
- Validate — The sidecar refuses env, printenv, set, export, cat, head, tail, less, more, echo, printf, tee, cp, mv, dd, base64, xxd, od, hexdump, strings, and any interpreter invoked with an inline-code flag — sh, bash, zsh, fish -c; python, python3 -c; node -e or --eval; perl -e; ruby -e; php -r; awk; osascript -e.
- Record — The refusal is audited with a reason and no value.
- Observe — Documentation states the denylist is a backstop; the controls are the allowlist and redaction.