Skip to content

Promote integration to main - #777

Merged
rocklambros merged 216 commits into
mainfrom
promote/full-7d7c7f20cfbe
Dec 3, 2026
Merged

rocklambros merged 216 commits into
mainfrom
promote/full-7d7c7f20cfbe

Conversation

@rocklambros

Copy link
Copy Markdown
Collaborator

Promotes all of integration at 7d7c7f20cfbe to main.

Built by tools/promote_pr.py --full: integration with main merged in using the ours strategy, so after this merges main equals integration exactly. Where the two differed, integration wins. These paths are where main held something integration no longer does:

.github/workflows/pr-base-guard.yml
docs/decisions/index.md
tests/test_roadmap_sync_promotion.py
tools/roadmap_sync.py

Merge with a merge commit, not a squash: squashing flattens the specification history that makes a schema change reviewable later. The person who ran the script pushed this branch, so a different code owner approves it.

esherman-credo and others added 30 commits October 29, 2026 15:47
The exporter already starts a span for any mapped method in methodsEvaluated,
but it had no sources for the attributes the mapping lists on the session and
message spans, so those spans went out without them. This adds sources for
acs.session.reason, acs.content.types, and the session span's optional
acs.tenant_id, acs.user.id and acs.policy_mode.

acs.content.types holds one entry per content item, in wire order, and is not
deduplicated. The mapping does not say whether it is a set; this keeps the
counts, and is a one-line change if the Spec leads prefer a set.

This Guardian does not evaluate the four methods yet, and PR #229 keeps them
out of methods_evaluated, so the spans do not appear in a live run. The tests
drive them through the exporter's methodsEvaluated option, as #322 describes.
Provenance on message content items is left for a later slice.

Part of #322

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Eli Sherman <esherman@credo.ai>
The mapping's provenance rule applies to every hook payload that attaches
Provenance. The message hooks attach it to each content item, and
sessionStart to its Intent as parser_provenance, but the exporter read it
only from tool arguments and outputs, so acs.message.user, acs.message.agent
and acs.session went out without it. provenanceObjects now reads those
carriers too, with the same columns, order, padding and limit.

The session and message tests now check that exactly one span with the
mapped name exists before asserting that an attribute is absent, so a dropped
span can no longer pass them. They also compare acs.request_id and
acs.agent.id against values the test chose, and run the decision and
guardian_error checks on all four methods.

Part of #322

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Eli Sherman <esherman@credo.ai>
#322 asks for the sample trace and the trace walkthrough to show the new
spans. The sample's exporter now also spans steps/sessionStart,
steps/userMessage, steps/agentResponse and steps/sessionEnd, through
methodsEvaluated as the tests do, and the generator sends one request for
each. This Guardian does not dispatch those steps yet, so each span carries a
guardian_error failure rather than a decision; its name and attributes,
message provenance included, are real exporter output. A sample test pins the
four spans and the attributes their requests carried.

The tree README says why "Produce a trace" shows no session or message span
in a live run and points to the sample, and the Guardian README and the
OpenTelemetry page count the sample's spans again.

Part of #322

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Eli Sherman <esherman@credo.ai>
Brings in #309, which changed the exporter's start() to take whether the
Guardian trusted the request. The session and message tests now pass TRUSTED,
the sample is regenerated, and the sample test and the two sample
descriptions count the session and message spans beside #309's rejected
request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Eli Sherman <esherman@credo.ai>
…e request gate

When several PreToolUse hooks deny one call, Claude Code shows the model the
denial reason of only the hook that finishes last, by JSON or by exit 2, and
drops the others. A project hook that answers after the shim therefore hides
the Guardian's reasoning, though the call stays blocked (issue #109). An
allow's permissionDecisionReason reaches only the debug log, so a fail-open
proceed never explained itself to the model either.

Claude Code keeps additionalContext from every hook. The hookmap now also
writes reasoning there on allow, deny, defer and modify. Measured with the
real shim and the reference Guardian under Claude Code 2.1.285 and 2.1.311,
beside a project hook that denies by exit 2 and finishes last: before, the
policy's reason never reached the model; after, it arrives as hook additional
context. The result gate needs no change, because Claude Code passes every
hook's block reason to the model.

Refs #109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Eli Sherman <esherman@credo.ai>
A test now renders allow, deny, defer and modify from the shipped hookmap with
a non-string reasoning and expects neither reason field, so dropping
`type: string` from an additionalContext rule fails it. The README's sample
shim output shows the new field. The hookmap comment points to the README for
the measurements, and the modify comment no longer implies its
permissionDecisionReason reaches the model.

Refs #109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Eli Sherman <esherman@credo.ai>
Review on #475: under on_decision_failure: proceed, an unreachable Guardian
becomes an allow whose reasoning says the Guardian is unreachable and the step
went through. As additionalContext, the model would read that before the step
runs, and an injected agent could time its next calls by it. The spec points
an ALLOW's reasoning at the user, and the audit log and trace export already
record every allow. So allow no longer writes additionalContext; deny, defer
and modify still do.

The fail-open posture test now asserts the reasoning is not in
additionalContext. The README links Claude Code's hooks documentation, and the
tree README's sample deny output shows the new field.

Refs #109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Eli Sherman <esherman@credo.ai>
The host's audit log records a fail-open proceed; the Guardian's trace
cannot, so the README and hookmap no longer claim both record every allow.
A wire-shape comment no longer says an allow's reason reaches the transcript,
the per-hook render test is no longer named "exactly as before", and the
non-string reasoning matrix covers ask too.

Refs #109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Eli Sherman <esherman@credo.ai>
The test gave one content item `origin: "retrieval"`, which provenance.json
does not allow (it is `retrieved`), so both message envelopes in that test
failed their hook schemas. Found by validating every slice-1 test envelope
against request-envelope.json and its hook schema, as the review asked. The
other envelopes are valid, apart from the acs.content.types edge cases, which
are invalid on purpose.

Part of #322

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Eli Sherman <esherman@credo.ai>
The agt and guardian READMEs say policy/manifest.drift.yaml is used to
reach the warn verdict. It denies every call on annotation_failed: the
Guardian has no drift_score annotator, and data.json sets no
drift.warn_threshold. Correct both READMEs and the manifest header, and
pin it with a test.

Closes #379

Signed-off-by: aaronormerod <137795541+aaronormerod@users.noreply.github.com>
post() parsed the response body without reading the status, so a 401 or
403 from the Guardian endpoint, or from whatever authenticates in front of
it, became a SyntaxError or an unrecognised JSON-RPC error. Both were left
to on_decision_failure, and under proceed the step ran even though the
adapter's credential had been rejected.

post() now throws GuardianHttpRefusalError for any 4xx except 408 and 429,
and classifyDeliveryFailure files it as refused, so the step is blocked
whatever the posture. 408, 429 and 5xx still follow the posture, and a 5xx
body is still read.

Part of #32.

Signed-off-by: Santosh Kumar Puppala <puppalas97@gmail.com>
Read's file content reached the model without passing the Guardian. The
shipped settings matched neither gate for Read, and the result gate's
hookmap knew only Bash's stdout.

Both settings matchers now include Read. The request gate reads its
file_path, and the policy manifest registers Read so AGT does not fail
closed on an unknown tool. At the result gate, outputs.by_tool gives
Read its own path next to the existing one, the way
policy_target_argument has a default and a by_tool map. Read's content
is $.tool_response.file.content, and a modification is written back
within $.tool_response, so Claude Code gets the shape it expects.
buildPayload and governStep pick the path through the same function,
outputsFor, and loadHookmap rejects a malformed by_tool entry. Bash
keeps its path.

Measured live on Claude Code 2.1.325: the model receives the file with
the example key replaced by [REDACTED].

Read is governed on text only. An image, a PDF or a notebook has no
file.content, so the posture decides, as the hookmap and the README now
say. #568 tracks those types.

Refs #330

Signed-off-by: Marco Bellingeri <49072576+MK023@users.noreply.github.com>
Under deny, a Read of an image, a PDF or a notebook has no leaf to
replace, so the shim exits 2 at PostToolUse and Claude Code delivers the
output anyway. The audit log said blocked. It now writes an unenforced
entry that names the tool, and the stop says on stderr that the agent
received the output.

The Claude Code shim declares this with resultGateStopWithholds: false.
OpenCode keeps writing blocked. The Inspector reads, prints and counts
the new entry, and the OTLP converter skips and counts it.

Part of #568.

Signed-off-by: Marco Bellingeri <49072576+MK023@users.noreply.github.com>
With a key file, anyone who reached the model port spent the operator's key. On a Linux host that includes every local user, through the bridge network, whatever the key file's mode.

ACS_GATEWAY_CLIENT_TOKEN_FILE names a bearer token, loaded under the same file rules as the approver secret. Middleware in front of every model-port route compares the Authorization header with it in constant time, before the body is read, in replay as in live. A missing or wrong token gets the Responses API's 401 invalid_api_key, reaches no upstream, never gets the key, leaves no model input line, and is audited as client_unauthorized without the header's value. A key file now needs the token, so the gateway refuses to start without it, and live or capture refuse a token without a key file, since the client's header would otherwise carry it upstream. The existing key swap replaces the token on the upstream request.

Signed-off-by: Rock Lambros <rock@rockcyber.com>
The client-token gate passed every non-HTTP scope through untouched. No route serves a websocket today, but one added later would have skipped the token check. The gate now passes only lifespan, closes a websocket handshake with 1008 and audits it, and drops any other scope type.

Signed-off-by: Rock Lambros <rock@rockcyber.com>
With a key file the client token is mandatory, so the shared-key startup line and the off-loopback refusal overstated the risk: a client that reaches the port without the token spends nothing. Both now name the token holder. The matching README sentence went in with the previous commit.

Signed-off-by: Rock Lambros <rock@rockcyber.com>
A gateway that holds the model key now refuses to start without a client token, and every model port request without the token gets a 401. The gateway README gains an upgrade section that says so, the CHANGELOG opens an Unreleased section with the same entry, and the adapters threat model stops saying the model port takes no credential.

Signed-off-by: Rock Lambros <rock@rockcyber.com>
The client token comments and test docstrings cited review labels that mean nothing outside the review. Each now says why the code does what it does: only a client holding the token spends the model key, a non-HTTP scope fails closed, and a key file needs the token or the gateway refuses to start.

Signed-off-by: Rock Lambros <rock@rockcyber.com>
…file

Tests now prove that a refused request never reads the body, that two Authorization headers are refused, that the token is compared with hmac.compare_digest, and that live, openai, capture and ACS_CAPTURE=1 each refuse a client token without a key file.

The token file is capped at 4096 bytes and must hold one printable line with no spaces, so a malformed file stops startup with a message that never carries the token, instead of leaving every client with a 401. Startup also refuses a client token equal to the approver or admin token, so the governed agent can't hold a secret that approves its own calls or resets the epoch.

The README now says what a websocket upgrade really gets, lists the websocket audit cause, and states the full file rules. The CHANGELOG entry carries the new rules.

Signed-off-by: Rock Lambros <rock@rockcyber.com>
The distinct-token check read the admin and approver token files even when their listeners were off, so an unused, missing or loose file stopped a startup that 0.1.5 allowed. It now reads the admin token only with an admin port, and the approver token only with an approver port in enforce, as the startup code does.

The README and CHANGELOG now say the 4096-byte cap counts the whole token file, trailing newline included, which is what the loader checks.

Signed-off-by: Rock Lambros <rock@rockcyber.com>
Signed-off-by: Rock Lambros <rock@rockcyber.com>
Closes #585

Signed-off-by: Rock Lambros <rock@rockcyber.com>
Closes #586

Signed-off-by: Rock Lambros <rock@rockcyber.com>
…it (#647)

Closes #587

Signed-off-by: Rock Lambros <rock@rockcyber.com>
Closes #588

Signed-off-by: Rock Lambros <rock@rockcyber.com>
Closes #589

Signed-off-by: Rock Lambros <rock@rockcyber.com>
…#660)

Part of #587

Signed-off-by: Rock Lambros <rock@rockcyber.com>
D-044 made AgBOM an ACS sub-stream. Add her row to the workstream table, give her code ownership of the inspect docs and AgBOM schemas, and declare the workstream:agbom label.

Signed-off-by: rocklambros <rock@rockcyber.com>
rocklambros and others added 11 commits December 2, 2026 22:52
…4.39.4

Signed-off-by: Rock Lambros <rock@rockcyber.com>
Signed-off-by: Rock Lambros <rock@rockcyber.com>
PR #359 changed packages/guardian/src and PR #541 changed policy/, so
TestRecordingIsCurrent no longer matched. Re-recorded once with
scripts/record-ts-cases.sh after every PR in the batch was merged. Only
the two input hashes changed: every recorded decision is the same.

Signed-off-by: Rock Lambros <rock@rockcyber.com>
The sample trace now sends PR #359's session and message steps before the
denied tool call, so that call's acs.chain_hash changed.
tests/test_trace_docs_example.py requires the page's example to match the
sample's span.

Signed-off-by: Rock Lambros <rock@rockcyber.com>
Merge the reviewed PRs for release 0.1.6
)

Refs #209

Signed-off-by: Rock Lambros <rock@rockcyber.com>
…on (#772)

Closes #771

Signed-off-by: Rock Lambros <rock@rockcyber.com>
Signed-off-by: Rock Lambros <rock@rockcyber.com>
Signed-off-by: Rock Lambros <rock@rockcyber.com>
Signed-off-by: Rock Lambros <rock@rockcyber.com>
Signed-off-by: rocklambros <rock@rockcyber.com>
Comment thread .github/workflows/deploy-pages.yml Resolved
@rocklambros
rocklambros merged commit 8eae5e3 into main Dec 3, 2026
51 checks passed
@github-project-automation github-project-automation Bot moved this from Needs triage to Done in ACS Project Tracker Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.