Skip to content

[Bug] Raw envelopes reach disk before redaction runs, with no file mode set #71

Open

Description

@rocklambros

Found by a six-perspective adversarial review of #60.

packages/guardian/src/envelope-log-sink.ts:10-19 states the design plainly: "no field stripping, no redaction, no reordering." server.ts:517 writes the request to .acs/envelopes.jsonl on parse, before dispatch() and before any policy evaluation. ToolCallRequestPayload.raw_command and ToolCallResultPayload.outputs carry the shell commands and tool output that hold credentials.

The sharp part is an asymmetry in the test suite. Dozens of assertions cover redaction on the model-facing path, in hosts/opencode/test/result-gate.test.ts and apply-opencode-output.test.ts. There are none on the envelope-log or audit-sink path. A reader who sees the first set concludes secrets are handled.

Neither audit-sink.ts nor envelope-log-sink.ts passes a mode to mkdirSync or appendFileSync, so files land at the process umask, typically world-readable.

.acs/ is gitignored, which closes the accidental-commit path. That is not the same as the file being safe at rest.

Activity

  1. added
    type:bugSomething isn't working
    scope:in-focusFeeds the ninety-day committed outcome. Maintainers only
    workstream:sdkOwning workstream. Maintainers only
    on Sep 10, 2026
  2. moved this to Needs triage in ACS Project Trackeron Sep 10, 2026
  3. rocklambros commented on Oct 12, 2026

    @rocklambros
    CollaboratorAuthor

    A third file joins the two listed here. #244 adds an OTLP trace file (ACS_OTEL_FILE) that holds decision reasoning, tool names, capabilities, and provenance source_id values, which can be URLs or file paths. Raw tool arguments are not exported. I've asked #244 to create that file with mode 0600 and its directory with 0700, so it should not need fixing here. Please include it when checking this issue's acceptance criteria. Its sample collector config is also moving debug to verbosity: basic, so it doesn't print every attribute to stdout.

  4. MK023 commented on Oct 27, 2026

    @MK023

    Here is a measurement from a real Claude Code session: Claude Code 2.1.308, ACS integration at fd6ff383, the shipped hook and the stock manifest.

    The model ran cat on a file containing AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE, the example key from the AWS documentation. The result gate answered modify with redaction_applied, and the model received AWS_ACCESS_KEY_ID=[REDACTED].

    The steps/toolCallResult request in .acs/envelopes.jsonl still holds the key in plaintext, at params.payload.outputs[0].value. The Inspector log holds it in plaintext too. The .acs/*.jsonl files had mode 644. All four runs, three non-interactive and one interactive, gave the same result.

    The redaction protects what the model sees, but the Guardian's own log keeps the plaintext. README line 370 already says this for tool arguments: "Nothing is stripped or redacted, so the file holds raw tool arguments." My runs show that it holds for tool output as well.

  5. moved this from Accepted to In progress in ACS Project Trackeron Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P1Maintainers onlyscope:in-focusFeeds the ninety-day committed outcome. Maintainers onlystatus:acceptedIn the backlog. Maintainers onlytype:bugSomething isn't workingworkstream:sdkOwning workstream. Maintainers only

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions