Skip to content

Add negative controls for the conformance runner - #293

Open
astrogilda wants to merge 5 commits into
GenAI-Security-Project:release/0.2from
astrogilda-forks:test/negative-controls-53
Open

astrogilda wants to merge 5 commits into
GenAI-Security-Project:release/0.2from
astrogilda-forks:test/negative-controls-53

Conversation

@astrogilda

@astrogilda astrogilda commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

@rocklambros, this is the tests/ file promised on #53, for the suite that #19 gave the Spec workstream of @bar-capsule and @afogel. tests/test_negative_controls.py covers requirements 2, 3, 4, 5, 7, 9 and 11 with subjects a small runner must refuse, like an allow-everything Guardian. Its MUTANTS list holds eight single-line weakenings of that runner, one per guard, and a control catches each.

The replay group now covers the lost-response retry from #53, a byte-identical resend that section 10.3 refuses as a repeated request ID. A Guardian that answers the resend as an idempotent retry fails request-resent-after-lost-response, and the runner refuses a suite that never resends.

The reference Guardian fails four section 10 MUSTs today, on signatures, replay and the skew window, and those vectors are strict xfails citing #184.

Which issue does this implement

Part of #33; refs #53.

I tested this

At df234a9, pytest gives 946 passed and 8 skipped, and the strict mkdocs build passes. The skips are the eight reference Guardian cases, and the Bun job agt in reference-implementation.yml runs them: 3 passed, 5 xfailed.

Edited 2026-10-24: added the lost-response resend vector (df234a9) and its test run.

Issue 53 lists what a conformance suite has to get right. Requirements 2,
3, 4, 5, 7, 9 and 11 are about the gate rather than any one Guardian, so
each gets a control here: a stub Guardian or a corpus the runner must
refuse, and seven runner mutants that at least one control must catch.

The runner is standard library only and runs as a child process. It posts
signed envelopes over HTTP and scores by section 17.1 code, never by
message text. The same vectors run against the reference Guardian, where
the four known gaps (signature, missing signature, repeated request_id and
the skew window) are strict expected failures that cite issue 184.

Signed-off-by: Sankalp Gilda <23521054+astrogilda@users.noreply.github.com>
The test job in deploy-pages.yml has no Bun, so the reference Guardian
group in tests/test_negative_controls.py skips there. The agt job already
installs Bun and the tree's dependencies, so it now runs that file too,
with ACS_REQUIRE_REFERENCE_GUARDIAN set so the group fails rather than
skips when the Guardian cannot start.

Signed-off-by: Sankalp Gilda <23521054+astrogilda@users.noreply.github.com>
The runner's key derivation matches the parameters pull request 272 adds
to section 10, so the docstring now says so instead of describing them
as this runner's own choice.

Signed-off-by: Sankalp Gilda <23521054+astrogilda@users.noreply.github.com>
Each strict xfail reason now names the section whose MUST the reference
Guardian fails, so the marker reads as a known failure rather than as an
optional case.

Signed-off-by: Sankalp Gilda <23521054+astrogilda@users.noreply.github.com>
An agent that loses the response to a non-idempotent call resends the
same request, signature and timestamp included. A Guardian that answers
that resend with its first decision, as an idempotent retry, lets the
action run twice, and it passes every single-request replay vector.

Add a replay vector that resends the previous request unchanged and
expects REPLAY_DETECTED under section 10.3, a stub Guardian that treats
the resend as idempotent and must fail exactly that vector, a rule that
refuses a suite with no resend, and a runner mutant the conformant
control catches. The reference Guardian does not track request_id, so
the new vector joins its strict expected failures.

Signed-off-by: Sankalp Gilda <23521054+astrogilda@users.noreply.github.com>

@drk-ram drk-ram left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged df234a9 onto origin/integration at d09e1bd. 1b8f970 is an ancestor of that tip. The merge is clean.

python -m pytest -q gave 1179 passed, 9 skipped, 10 failed, and 49 errors. tests/test_negative_controls.py was 23 passed and 8 skipped. The 8 skips are the reference Guardian group. This machine has Bun, and it does not have reference-implementations/agt/node_modules. The 10 failures and 49 errors are the same Windows environment failures as on the other merges. They are not in this diff.

The 8 built-in mutants are inside that 23 passed, so each listed weakening is caught. I broke three more things in the runner.

Ignoring an identical resend failed 4 tests. Zeroing the out-of-window timestamp offset failed 4 tests. Dropping resend from VARIED failed the suite-that-never-resends control.

The HKDF in the runner matches the parameters now in section 10. SHA-256, 32 zero bytes of salt, session_id as info, 32-byte output. The lost-response vector is a byte-identical resend, and section 10.3 refuses that as a repeated request_id. That does not collide with pull request 294. That one covers a retry under a new request_id, which must not inherit the earlier approval.

I read the Guardian source rather than starting it. examineStep records request_id_duplicate and does not reject. The trace exporter comment still says this Guardian verifies no signature, replay, or timestamp yet. The five strict xfails still match the code, so they should not flip to XPASS on this tree.

One gap is smaller than a block. timestamp is not in VARIED. A substituted corpus can keep a window group without moving the timestamp, and the structural gate will not refuse it. The default vector does move it, and zeroing that offset fails the conformant control. Worth a follow-up line in VARIED, not a reason to hold this.

The new workflow step sets working-directory to the repo root. That overrides the job default of reference-implementations/agt, so uv sync runs where pyproject.toml is. The actions are SHA-pinned, and the job stays contents: read.

@rocklambros
rocklambros changed the base branch from integration to release/0.2 November 26, 2026 14:27
@github-actions github-actions Bot added the status:needs-triage Not yet triaged. Applied by the issue forms label Nov 26, 2026
@github-actions

Copy link
Copy Markdown

Thanks for this. It is queued rather than ignored until a lead reads it, and the lead may close it. No lead has reviewed this pull request, and it references no issue a lead assigned to you. Under Part 2 of the Code of Conduct, a pull request that changes behavior, normative text, or code starts from an issue labeled status:accepted that a lead assigned to you before you opened or reopened it. If a lead closes this one, you can reopen it once a lead assigns the work. An editorial fix needs no issue. If a check below fails, please fix it.

@rocklambros

Copy link
Copy Markdown
Collaborator

I moved this PR's base to release/0.2, the new branch for 0.2 work. Changes to the spec, the schemas, or the conformance requirements now go there, and PR #675 records that rule as D-052. The branch starts at today's integration, so your diff is the same and you don't need to do anything right now. From now on, sync with release/0.2.

@rocklambros

Copy link
Copy Markdown
Collaborator

Hi Sankalp, I opened #686 for the part of #33 that this PR delivers. #686 is accepted, on the v0.2.0 milestone, and linked under #33. CONTRIBUTING.md (D-041) only reviews a pull request whose issue is assigned to its author. GitHub only lets us assign people who have access to the repository, so I sent you a read-access invitation today.

Here is how we fix it:

  1. Accept the invitation. It is at https://github.com/GenAI-Security-Project/agent-control-standard/invitations and in your GitHub notifications. It expires after 7 days.
  2. I assign Add negative controls for the conformance runner #686 to you and post here when it's done.
  3. In the issue section of this pull request, write Closes #686 on the first line and keep Part of #33 on its own line below it.
  4. Close this pull request and reopen it, so it counts as opened after the assignment.
  5. Then I review it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:needs-triage Not yet triaged. Applied by the issue forms

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants