Repository navigation
fix(adapters): default omitted enforcement mode to declared - #417
Closed
solloek369-arch wants to merge 1 commit into
Closed
solloek369-arch wants to merge 1 commit into
solloek369-arch wants to merge 1 commit into
Conversation
Follows agentrust-io#416. Evidence constructors must not infer policy enforcement from an omitted enforcement_mode. TraceSandboxAdapter and TraceAGTAdapter now default omission to declared while preserving explicitly supplied modes. The Sandbox Literal is extended only to admit the new default. AGT remains typed as str. Runtime enforcement defaults are unchanged. Signed-off-by: Loek <solloek369@gmail.com>
Member
|
Thanks Loek. #416 found a real problem: both adapters signed |
imran-siddique
added a commit
that referenced
this pull request
Sep 25, 2026
…rs (supersedes #417) (#419) * fix(adapters): default omitted enforcement mode to declared Follows #416. Evidence constructors must not infer policy enforcement from an omitted enforcement_mode. TraceSandboxAdapter and TraceAGTAdapter now default omission to declared while preserving explicitly supplied modes. The Sandbox Literal is extended only to admit the new default. AGT remains typed as str. Runtime enforcement defaults are unchanged. Signed-off-by: Loek <solloek369@gmail.com> * fix(adapters): require enforcement_mode instead of defaulting it Neither TraceAGTAdapter nor TraceSandboxAdapter evaluates a policy, so neither can know which enforcement mode applied. An "enforce" default signs a claim of evaluation nothing observed (#416), and the "declared" default from the previous commit is ruled out by spec section 4.3: declared MUST NOT be a default. The argument is now required; omitting it raises TypeError. Docs, the tutorial and the tests pass the mode explicitly, and the changelog entry is marked breaking. Signed-off-by: Imran Siddique <imran.siddique@opaque.co> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Signed-off-by: Loek <solloek369@gmail.com> Signed-off-by: Imran Siddique <imran.siddique@opaque.co> Co-authored-by: Loek <solloek369@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Implements the
trace-specportion of #416.TraceSandboxAdapterandTraceAGTAdapterno longer infer policy enforcementwhen
enforcement_modeis omitted.policy.enforcement_mode="declared"enforce,advisory,silent, anddeclaredremain unchangedTraceSandboxAdapter's existingLiteralincludesdeclaredso its annotation matches its defaultTraceAGTAdapterremains typed asstrWhy
#416 established that an evidence constructor must not infer enforcement from an
omitted argument.
declaredbinds the named policy without asserting that thisconstructor observed policy evaluation or enforcement. Callers with an
independently established enforcement context pass the actual mode explicitly.
Compatibility
This changes emitted evidence for callers that previously omitted
enforcement_mode:enforcedeclaredCallers that actually established enforcement can continue to pass
enforcement_mode="enforce"explicitly.No normative specification, schema, wire-format, or runtime-enforcement behavior
changes.
Validation
Local validation on Python 3.12.14 after
pip install -e ".[dev]". These results are not a CI run.constructor default to
enforce; each failed on the intended'enforce' != 'declared'assertion and passed again after byte-exact restorationFollows #416.