Skip to content

docs(spec): add agent-change-admission-v1 predicate for change admission - #593

Open
zhaoxinghua09-cell wants to merge 6 commits into
GenAI-Security-Project:release/0.2from
zhaoxinghua09-cell:agent-change-admission-v1
Open

zhaoxinghua09-cell wants to merge 6 commits into
GenAI-Security-Project:release/0.2from
zhaoxinghua09-cell:agent-change-admission-v1

Conversation

@zhaoxinghua09-cell

@zhaoxinghua09-cell zhaoxinghua09-cell commented Nov 17, 2026 •

Copy link
Copy Markdown

Which issue does this implement

Part of #33. This change does not resolve that issue: the namespace, the directory and the
vector format are still open questions, and I am asking them in Refs #596 rather than
answering them by landing code.

Proposes a predicate family for the question GenAI-Security-Project#33 raises: who may admit an
agent's configuration change, and on what evidence. Two conditions from the
3 Nov thread are made normative rather than prose: the lift must bind the
payload the peer witnessed, and EXTERNAL independence must cover the Guardian
as well as the agent.

The spec ships with an executable conformance checker and 23 vectors (P1-P3
positive, N1-N20 negative), one per rejection reason code, built on real
Ed25519 keys generated in-process.

Known gap, stated rather than papered over: v0.1.0 has no registry and no
steward body, so this predicate cannot point at a revocation authority yet.
The checker treats a missing registry as fail-closed instead of fail-open.

Reviewed externally before posting: three models served via SiliconFlow
(DeepSeek-V3.2, GLM-5.3, Qwen3.5-27B) returned 56 findings against the draft.
About 35 were real and are fixed here, including a role-block confusion that
let a witness key sign a peer verdict, an empty-digest equality that passed
the subject check, and a replay path that admitted a byte-identical
re-submission.

Signed-off-by: Xinghua Zhao <zhaoxinghua09-cell@users.noreply.github.com>
Signed-off-by: Xinghua Zhao <zhaoxinghua09-cell@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Thanks for this. It is queued rather than ignored. A lead has not reviewed this pull request yet. A lead will read it when they have time, and we can't promise a date. Nothing here is rejected. If a check below fails, please fix it. A pull request that waits a long time may be closed, and you can reopen it later.

…eck demanded

Every https: type URI in the draft returned HTTP 503. The host was ours, but
it serves nothing, which makes those identifiers a defect a reviewer finds
with one curl. Since ACS v0.1.0 has no registry (docs/spec/conformance.md says
so outright), there is no authority to resolve a type URI against; a URN states
that honestly. https: URIs will be minted when a registry exists, with these
URNs kept as aliases so nothing signed today becomes unverifiable.

Also regenerated examples/ so the vector files carry the new identifiers;
23/23 still passes.

Signed-off-by: Xinghua Zhao <zhaoxinghua09-cell@users.noreply.github.com>
zhaoxinghua09-cell and others added 3 commits November 17, 2026 13:53
Review feedback: the MUST NOT dereference / fail-closed requirement sat inside a rationale paragraph, so a reader scanning for normative text could miss it. Rationale now records the observed 503 and the absence of a registry; the requirement is its own subsection. Also removes colloquial phrasing.

Signed-off-by: Zhao Xinghua <zhaoxinghua09@users.noreply.github.com>
Resolves the nav conflict with the conformance-claim-template entry that landed
upstream, so the branch is mergeable again. No content change beyond mkdocs.yml.

Signed-off-by: Zhao Xinghua <zhaoxinghua09@users.noreply.github.com>
The render test pins the pane's expanded row count to the design's number. Adding one
group and one entry makes it 55. The premortem's derivation is left as the historical
record; this is the new number that follows from the nav in this branch.

Without this the PR would fail test_render_nav_emits_the_pane_in_order, which is not a
test about predicates, and a reviewer should not have to discover that.

Signed-off-by: Zhao Xinghua <zhaoxinghua09@users.noreply.github.com>
@zhaoxinghua09-cell

Copy link
Copy Markdown
Author

CI is green now. Two things were red, and neither was in the diff.

closing-choice failed twice, both times because of the description. The rule wants a
## Which issue does this implement section, and that section extends to the next ## heading,
so my first fix put the section mid-body and pulled every later issue reference into it. The
section now sits at the end and reads Part of #33 ... Refs #596 .... Before editing I ran the
same tools/closing_choice.py locally under python3 -I -S with the title and body in the
environment, which reports closing choice: pass.

Latest runs on cef74ab: closing-choice SUCCESS (run 44030076910), dco / test / triage / tests /
tests-without-nat / build / package 3.11 and 3.12 all SUCCESS. deploy is skipped for pull
requests, as the workflow intends. The earlier closing-choice failures on this same commit are
superseded attempts; statusCheckRollup still prints FAILURE because those contexts stay
attached to the commit.

The diff is unchanged since my last message. A fresh clone of the branch gives 4 failed / 1234
passed, which is what untouched integration gives on this machine too (one theme JS hash drift,
three roadmap git tests). One test moved with the change rather than around it:
tests/test_render_landing.py pins the expanded nav row count, and one new group plus one entry
takes it from 53 to 55.

I am making no further changes until someone reads this. If it helps, I am happy to split the
predicate document from the checker and the vectors into two pull requests.

@rene-founder

Copy link
Copy Markdown

Hi @zhaoxinghua09-cell and @narko4u,

Following up on my note in #33, I ran a local check against verify(statement, ctx) at commit cef74ab7cc5bbcea2c59d91f8c0bb6eaffff5be9 (PR #593) and reproduced two edge cases on the external anchor path. The signed vectors and their verification context are included below.

  1. Partial independence (D1): Starting from the official P3 external anchor fixture, independent_of names only the agent while omitting the Guardian, re-signed with the same fixture key. The checker returns {"ok": true, "scope": "external", "codes": [], "kind": "anchor"}. Section 6 and AC-4 require independence covering both the agent and the Guardian, whereas the identity check at line 162 rejects only when both are absent.

  2. Unbound admission digest (D2): Using the same P3 fixture, binds.statement_digest.sha256 is changed to a different valid-format digest and re-signed, leaving the expected admission digest in the verifier context unchanged. The checker returns the same acceptance because the anchor branch does not compare those two digests.

Across P3, D1, and D2, the verifier context and signing key remained identical, and the signatures pass under the checker's current convention. Existing negative controls for an invalid signature, a missing pin, and neither identity being named reject as expected. The unchanged 23-vector suite also passes. In isolated local copies, enforcing both identities rejects D1 and comparing the admission digest rejects D2 while keeping P3 green. Restoring the original checker restores acceptance of both cases.

These results apply strictly to the standalone checker and its synthetic fixtures. They preserve the fixture's signing convention and omission of registry_revision, so acceptance of P3 is an implementation control, not a claim of complete normative conformance. They do not establish a deployed Guardian compromise or an end-to-end replay.

Reproducible signed vectors (D1 & D2) and verification snippet

The three JSON files below contain the frozen inputs used in this reproduction. Save each as UTF-8 without a BOM, using LF line endings and one final newline, to preserve the listed file hashes.

The public context contains only public keys. Do not regenerate it with build(): that would create different keys, and these frozen signatures would no longer verify.

D1-agent-only.json

SHA-256: 9427ac1911c321f30ec1de977b2e8f269d1fe7561a86802c428d331e36c1cc1d

{
  "_sig": "UvcWxnez+o7dJCq2OLW0rPv6Ij3vXyG3E6r7psHEk5bDrLiSGMxXo+5ulN09ndf8L2De6bR08yiuVAftVxaJAw==",
  "_type": "https://in-toto.io/Statement/v1",
  "predicate": {
    "anchor": {
      "key_id": "anchor-key-1",
      "org": "org:independent-notary",
      "pin": {
        "key_fingerprint": "sha256:3aedf812d4b9ff0af7d78eef9c9dc6f2894267fd1db86a7019c2684ccb20b09a",
        "pinned_at": "2026-10-30T00:00:00Z",
        "registry_uri": "https://registry.example.org/keys/anchor-key-1"
      }
    },
    "anchored_at": "2026-11-17T02:00:00Z",
    "binds": {
      "statement_digest": {
        "sha256": "e00e40c5e0f8fa64d01d9030ac7650d5ca2a68596223920fa1848d56ed184cc1"
      }
    },
    "independent_of": [
      "agent:researcher-01"
    ],
    "witness_scope": "external"
  },
  "predicateType": "urn:lgd:acs:predicate:agent-change-anchor:v1",
  "subject": [
    {
      "digest": {
        "sha256": "16aad0ab433ac8e5d9b962b7a60d69212eb3ea356abb044887d05281b314b7af"
      },
      "name": "change-payload"
    }
  ]
}

D2-wrong-admission-digest.json

SHA-256: af2bc052c2a891b6f437e88d7ce729cf1c255cb2c51c2e2fb0371552d1affc12

{
  "_sig": "z4H07MgqjP4HK1pouhWwG7ivj/69QCtnfH8fMWNeDr8jffL+QPzFoFNcLcWWD033+kAccfE4VRaM34Gw5gurBg==",
  "_type": "https://in-toto.io/Statement/v1",
  "predicate": {
    "anchor": {
      "key_id": "anchor-key-1",
      "org": "org:independent-notary",
      "pin": {
        "key_fingerprint": "sha256:3aedf812d4b9ff0af7d78eef9c9dc6f2894267fd1db86a7019c2684ccb20b09a",
        "pinned_at": "2026-10-30T00:00:00Z",
        "registry_uri": "https://registry.example.org/keys/anchor-key-1"
      }
    },
    "anchored_at": "2026-11-17T02:00:00Z",
    "binds": {
      "statement_digest": {
        "sha256": "000e40c5e0f8fa64d01d9030ac7650d5ca2a68596223920fa1848d56ed184cc1"
      }
    },
    "independent_of": [
      "agent:researcher-01",
      "org:guardian"
    ],
    "witness_scope": "external"
  },
  "predicateType": "urn:lgd:acs:predicate:agent-change-anchor:v1",
  "subject": [
    {
      "digest": {
        "sha256": "16aad0ab433ac8e5d9b962b7a60d69212eb3ea356abb044887d05281b314b7af"
      },
      "name": "change-payload"
    }
  ]
}

public-context.json

SHA-256: 357f57475b0e78cbcedd797ffc7658182073c64f9c1af9dce665fb32f06c8db0

The key values are raw Ed25519 public keys encoded as hexadecimal. The snippet reconstructs the key objects and the context's set and tuple-keyed dictionary before calling verify().

{
  "active_policy_versions": [
    "2026.11.1"
  ],
  "admission_context": {
    "request_id": "b0a2f7c4-2e21-4a10-9d55-0e6b8c2f4a13",
    "session_id": "6f1c2a9e-1d40-4d3e-9c3a-77ab01e2c9de"
  },
  "admission_statement_digest": "e00e40c5e0f8fa64d01d9030ac7650d5ca2a68596223920fa1848d56ed184cc1",
  "keys": {
    "anchor-key-1": "1515213d6e92d200998701b9bf92d2a6c287885b6337d315b63322998d45d2c0",
    "guardian-key-1": "a853897b6b0072271474410981204a3699dce31910ddbfe04e452c43a60852fe",
    "peer-key-1": "d7a4651fcd4dead4146421244e919493d63c463ee24d1453880bfee6797532d8"
  },
  "ledger": [],
  "observed": {
    "agent_id": "agent:researcher-01",
    "control_domain": "org:guardian",
    "key_id": "guardian-key-1",
    "org": "org:guardian"
  },
  "registry": {
    "anchor-key-1": {
      "fingerprint": "sha256:3aedf812d4b9ff0af7d78eef9c9dc6f2894267fd1db86a7019c2684ccb20b09a",
      "pinned_at": "2026-10-30T00:00:00Z",
      "writable_by_observed": false
    },
    "peer-key-1": {
      "fingerprint": "sha256:4f4786c1a574dcd0ba828ca9e3d6f31dd1f9895cfeef5ccfb0e3eb2480de6223",
      "pinned_at": "2026-10-30T00:00:00Z",
      "writable_by_observed": false
    }
  }
}

Verification

Use the unchanged checker from commit cef74ab7cc5bbcea2c59d91f8c0bb6eaffff5be9:

https://github.com/zhaoxinghua09-cell/agent-control-standard/blob/cef74ab7cc5bbcea2c59d91f8c0bb6eaffff5be9/docs/spec/predicates/agent-change-admission-v1/check_admission.py

Its SHA-256 is 249224c427c796025d20a3a0e1f6bc6469b7eba8bc9756b6ee464b5ea94cada1. The hash check below expects the original LF bytes.

Run from the repository root, with the three JSON files saved there and cryptography available in the selected Python environment. This reproduction was run with Python 3.14.0 and cryptography 46.0.3.

The command imports the checker and calls verify() directly. It does not invoke the native CLI or build(), generate keys, write bytecode, or contact the registry URL.

python -I -B -c "
import hashlib, importlib.util, json, sys
from pathlib import Path
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey

checker_path, data_dir = Path(sys.argv[1]), Path(sys.argv[2])
expected_checker = '249224c427c796025d20a3a0e1f6bc6469b7eba8bc9756b6ee464b5ea94cada1'
if hashlib.sha256(checker_path.read_bytes()).hexdigest() != expected_checker:
    raise SystemExit('Checker SHA-256 mismatch')

hashes = {
    'D1-agent-only.json': '9427ac1911c321f30ec1de977b2e8f269d1fe7561a86802c428d331e36c1cc1d',
    'D2-wrong-admission-digest.json': 'af2bc052c2a891b6f437e88d7ce729cf1c255cb2c51c2e2fb0371552d1affc12',
    'public-context.json': '357f57475b0e78cbcedd797ffc7658182073c64f9c1af9dce665fb32f06c8db0',
}
frozen = {}
for name, expected in hashes.items():
    raw = (data_dir / name).read_bytes()
    if hashlib.sha256(raw).hexdigest() != expected:
        raise SystemExit(name + ': SHA-256 mismatch')
    frozen[name] = raw.decode('utf-8')

spec = importlib.util.spec_from_file_location('checker', checker_path)
checker = importlib.util.module_from_spec(spec)
spec.loader.exec_module(checker)

for name in ('D1-agent-only.json', 'D2-wrong-admission-digest.json'):
    ctx = json.loads(frozen['public-context.json'])
    ctx['keys'] = {
        key_id: Ed25519PublicKey.from_public_bytes(bytes.fromhex(value))
        for key_id, value in ctx['keys'].items()
    }
    ctx['active_policy_versions'] = set(ctx['active_policy_versions'])
    ctx['ledger'] = {(sid, rid): digest for sid, rid, digest in ctx['ledger']}
    result = checker.verify(json.loads(frozen[name]), ctx)
    print(name + ': ' + json.dumps(result))
    assert result == {'ok': True, 'scope': 'external', 'codes': [], 'kind': 'anchor'}, result
" docs/spec/predicates/agent-change-admission-v1/check_admission.py .

Observed output:

D1-agent-only.json: {"ok": true, "scope": "external", "codes": [], "kind": "anchor"}
D2-wrong-admission-digest.json: {"ok": true, "scope": "external", "codes": [], "kind": "anchor"}

The command exits with code 0 and no stderr. Here, exit 0 means that the reported acceptance was reproduced. It does not mean these negative cases satisfy the intended requirements. The snippet reproduces D1 and D2 only; it does not rerun the separate controls or corrective calibration described above.

René Atencio Roa
Alekore Systems Inc.

Disclosure: I used AI assistance during the local verification.

@zhaoxinghua09-cell

Copy link
Copy Markdown
Author

Rene — thank you for running this, and for the frozen vectors; that is exactly the kind of check this predicate needs before it merges.

Both findings are accepted as real gaps in the checker as shipped at cef74ab: D1 shows the independence check does not enforce what §6 and AC-4 require (both agent and Guardian), and D2 shows the anchor branch never compares binds.statement_digest against the admission digest in the verifier context. The 23-vector suite passing does not cover either case, so I will add D1 and D2 as negative vectors and fix the checker — require both identities in independent_of for the external scope, and compare the admission digest — then re-run the full suite plus your two vectors and report the result here.

Scope noted: this is the standalone checker and its synthetic fixtures, not a claim about a deployed Guardian. I will also keep the P3 positive case green through the fix.

@rocklambros

Copy link
Copy Markdown
Collaborator

Hi Steven, this PR now conflicts with integration in tests/test_render_landing.py, because the expected navigation count changed when other docs pages landed. Could you rebase onto the current integration, update the count, and push? Integration dismisses approvals on every push, so a rebase before review means nobody has to approve it twice.

@rocklambros
rocklambros changed the base branch from integration to release/0.2 November 26, 2026 14:27
@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. Please rebase onto release/0.2 instead of integration. The two branches are the same commit today, so the conflicts from my earlier comment haven't changed.

@zhaoxinghua09-cell

zhaoxinghua09-cell commented Nov 29, 2026 •

Copy link
Copy Markdown
Author

Understood — rebuilding this on release/0.2 and updating
tests/test_render_landing.py's navigation count, then force-pushing. I'll
comment with the new head and the check result. D-052 (per your comment and
#675) noted.

— Individual expert, zhaoxinghua09-cell

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