Skip to content

About

AWS adapters for Requisition: Strands hook, AgentCore Gateway interceptor and target, offline checks

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

requisition-aws

AWS demo adapters for Requisition: a Strands Agents hook, an AgentCore Gateway REQUEST interceptor, and an offline check. They let an agent's tool call run only on Requisition's signed allow for that call's exact arguments.

Every Requisition feature these adapters use belongs to Requisition's evaluation environment: the /v1 API, the records it signs (Ed25519, with an ML-DSA-87 co-signature when one is configured, under development keys or AWS KMS keys), and its single-use execute. A production release of Requisition does not serve /v1, and it signs its own receipts with Ed25519 under a key it reads from its environment.

Licence: Apache License 2.0 (LICENSE, NOTICE). Third-party files keep their own licences; they are listed in THIRD-PARTY.md.

The pieces

file what it is
requisition_aws/canonical.py A port of Requisition's CanonicalPayload v3 encoder and of act_hash (sha384+canonical_payload.v3: SHA-384 of v3 over the arguments with act_type put inside). It also ports the intake rules: a float anywhere in the arguments refused float_refused (with its path, before any other check), Unicode Cc/Cf/Zl/Zp refused, NFC required, and the redactor's patterns (display_value_redactable). Every refusal happens before anything is sent, never as a truncation.
requisition_aws/client.py A stdlib HTTP client for the lab /v1 API: propose, get request, execute, keys. It can also use a Unix socket.
requisition_aws/store.py The idempotency store. It is a local JSON file with flock-guarded atomic conditional writes. It holds request_ids keyed on act_hash, the exact execute body bytes keyed on the call's idempotency key, and the hook's "tool ran" marks.
requisition_aws/gate.py The flow both adapters share: deduplicated propose, the sanction read, idempotent execute, and a check of every signed record against what was sent.
requisition_aws/strands_hook.py A Strands HookProvider. It requires exactly strands-agents 1.64.0 (the strands extra pins it): it reads Strands' private middleware registry, and on any other version it cancels every registered tool call. The flow is: propose, then event.interrupt with {request_id, approval_url}, then resume, then the hook re-reads the request, then execute, then the tool runs only on a signed allow. AfterToolCallEvent sets the "tool ran" mark. Every other outcome is cancel_tool (fail closed).
requisition_aws/interceptor.py A Lambda handler for an AgentCore Gateway REQUEST interceptor on MCP targets. It is not deployed.
requisition_aws/registry.py The tool to act type registry. An unregistered tool is denied.
requisition_aws/scripted_model.py A Strands Model with no network, used by the tests and by --scripted.
requisition_aws/demo_flow.py The demo's app loop: print the link, poll, resume, replay, verify, write the transcript.
bin/verify_offline.py Stdlib plus one vendored file; run it with python3 -I. It recomputes act_hash and the arguments digest from the arguments the approvers were shown, compares them with the signed record, then runs Requisition's unchanged bin/lab-verify. For an ML-DSA-87 record, or a record's ML-DSA-87 co-signature, it checks the post-quantum signature itself. --require-pq makes that signature mandatory.
bin/vendor/mldsa.py Filippo Valsorda's pure-Python ML-DSA verifier (PyPI mldsa 1.0.1, CC0-1.0 OR 0BSD), byte for byte, loaded by path under a pinned SHA-256. See bin/vendor/VENDORED.md.
requisition_aws/mcp_target.py Requisition as the AgentCore Gateway target. An MCP server (Streamable HTTP; 2026-07-28 and the 2025 versions) that owns the refund tool and runs it only on a signed allow it has checked. It writes REFUND SENT to a local ledger, then reports the outcome. deploy/target/Dockerfile packages it for AgentCore Runtime (ARM64, 0.0.0.0:8000/mcp). Not built for ARM64 and not deployed.
requisition_aws/pq.py The package's loader for the vendored verifier. keys.KeyRegistry uses it for mldsa87 key entries.
requisition_aws/target_flow.py The target form's demo loop. It speaks MCP to the served target over HTTP, as a Gateway would.
demo/run_demo.py The Strands demo (--airgap; --require-pq, default on, applies at run time and in the offline check; REQUISITION_LAB_KEY_FILE required and compared with GET /v1/keys).
demo/run_interceptor_local.py The interceptor demo.
demo/run_target_local.py The target-form demo.
demo/run_airgap.py Re-checks a finished run's records in docker run --rm --network none after a network probe, then shows a one-character change FAIL.
requisition_aws/fence.py F1, the relying party's own memory. Every signed record a form reads (statement, decision, outcome) is remembered by its signed (chain_scope, sequence); a different record at a held position is refused authority_equivocated and both are kept as evidence. Before acting on an allow, every form claims the statement and the approval_request_id it names, so a re-minted statement for an approval already acted on is refused approval_already_used. Store.admit does all of it in one transaction, persisted before the effect. No ordering rule: the lab's chain is the whole account's, so gaps are normal.
bin/verify_chain.py F1b, a stranger's offline check of one account chain export against held records (a relying party's position memory or evidence): link_broken, sequence_gap, sequence_duplicate, export_not_from_genesis, held_record_differs, export_short, equivocation, signature_invalid, held_record_invalid, held_other_scope, pq_missing, and the others its docstring lists (every one a row of the code table below). Stdlib plus two pinned vendored files: the Ed25519 routine copied from Requisition's verify_receipt.py, and mldsa.py. A rotated key's records verify inside the key's signing window (an honest rotated history passes); a key the key rule refuses (revoked, outside its window, a signer not accepted) is a trust refusal under the rule's own code, never signature_invalid. It judges the export it is given, not the live service.
bin/export_chain.sh The read-only SQL export of one account chain (psql, a READ ONLY transaction, COPY (SELECT ... ORDER BY sequence) TO STDOUT as CSV; the scope only as a psql variable). Point it at a copy made by Requisition's scratch-database wrapper, or at the demo database.
demo/run_rollback_local.py The rollback demo, local only. It runs inside Requisition's scratch-database wrapper (a database created for the run and dropped after it) on a copy of the demo database, with a second server on another port, started with the command the operator gives (--server-cmd, or ROLLBACK_SERVER_CMD; Requisition's scratch-server script states it). The source database (--source-db), the live server's port (--live-port, or the port of REQUISITION_URL) and the seed file (--seed, or REQUISITION_SEED) are given by the operator too; the demo holds no name of a database or a server, no command of the server and no place inside its checkout. The refund runs once; the database is restored to before the mint; the restored service re-mints and would allow again; the target refuses authority_equivocated; verify_chain.py FAILs the restored export. --dry-run checks the copy and the restore round trip without a server. Its claim, word for word: "If Requisition's database is rolled back, the same executor, with its own records intact, refuses to act again, and the rollback leaves two different records signed by the service's key at one chain position, which anyone can check offline. Lab profile, lab key. (when nothing was appended between the snapshot and the mint; step 7 checks this and stops otherwise)."
demo/rehearse.sh The one-command dress rehearsal: the Strands demo, the interceptor, the target, then the airgap check. Each step prints a short transcript through demo/present.py, with credentials elided. REHEARSE_DRY=1 runs all four against a local fake.

Install

The package is requisition_aws; its one dependency outside the standard library is cryptography. The wheel also carries the vendored ML-DSA verifier (bin/vendor/mldsa.py) inside the package. From PyPI:

python3 -m pip install requisition-aws==0.3.0

On a machine without network access, use the release's offline bundle: the wheel, the wheel of every dependency, and a requirements.txt that pins each of them by SHA-256. In the unpacked bundle:

python3 -m venv .venv
.venv/bin/pip install --no-index --find-links wheels --require-hashes -r requirements.txt

pip installs only files whose SHA-256 is listed, and --no-index keeps it off the network. The bundle's README.md says how to check the bundle itself before installing. The scripts in bin/ and demo/ are not in the wheel; they are in the source archive and in this repository.

The offline verifiers' answers (0.3.0)

One default accept set: bin/verify_offline.py, bin/verify_chain.py, bin/lab-verify and KeyRegistry (its constructor, from_bytes and from_file, as from_env already did) accept the signer kms alone unless they are told otherwise (--accept-signer LABEL, repeatable, or --accept-signer any; accept_signers=[...], or None for every signer): a development key's record is refused signer_not_accepted unless --accept-signer dev is given. A pass under a key that is not a lab KMS key is a lab pass, never exit 0: bin/verify_offline.py and bin/verify_chain.py exit 8 ending verdict_code: lab_dev_key, and KeyRegistry.judge and the gate's Decision and Sanction carry lab true. No flag of any of these verifiers lifts a refusal it makes for a stripped co-signature; --allow-classical-only lifts the post-quantum expectation only.

bin/verify_offline.py exits 0 PASS when every key that signed is a lab KMS key, and 8 for the same pass under a key that is not (a LAB PASS, ending verdict_code: lab_dev_key, the status bin/lab-verify gives its own: a development key is exportable); 1 the record is refused (the binding, its signed bytes not read, no receipt_hash, or the --expect-receipt-type / --expect-statement-id checks); 2 usage: nothing was judged (an input not read, one over 1,048,576 bytes, a record file holding two record forms such as a receipt beside a decision, an unknown key file algorithm, an empty --act-type); 3 bin/lab-verify answered otherwise (its own code is passed on); 4 the post-quantum half (pq_missing, the co-signature's codes, the record's own ML-DSA-87 signature); 6 the log checkpoint. bin/verify_chain.py exits 0 ok, 8 ok under a key that is not a lab KMS key (lab_dev_key), 1 FAIL, 2 usage (every input file within the same bound); it takes --allow-classical-only. Every refusal ends with verdict_code: <code>, and so does a usage error that names the form of an input it read (record_form_ambiguous, key_algorithm_unknown). Every code is a row of one table shared by every public verifier of these records, tests/vectors/conformance/codes.json; the record checks' RecordInvalid.code and KeyError_.code use it too. The gate's release and admission codes (release_unstated, release_mismatch, allow_already_released, approval_already_used, authority_equivocated) are the gate's own, not rows of that table. The codes of each checker of this package, as the table lists them (tests/test_readme_codes.py checks these lines against it):

  • offline (bin/verify_offline.py): act_hash_alg_unknown, act_hash_mismatch, checkpoint_not_established, cosignature_invalid, cosignature_malformed, cosignature_stripped, inner_answer_unexpected, key_algorithm_unknown, key_fingerprint_mismatch, key_not_valid_at_signing, key_public_key_malformed, key_revoked, key_status_unusable, key_window_unreadable, lab_cosignature_stripped, lab_dev_key, lab_kms_key, lab_recorded_no_authority, lab_signature_unchecked_mldsa87, pq_missing, receipt_hash_mismatch, receipt_hash_missing, receipt_type_unexpected, record_form_ambiguous, signature_invalid, signature_malformed, signed_instant_unreadable, signed_payload_unreadable, signer_not_accepted, statement_id_mismatch.
  • chain (bin/verify_chain.py): cosignature_invalid, cosignature_malformed, cosignature_stripped, displayed_field_mismatch, equivocation, export_not_from_genesis, export_short, held_other_scope, held_record_differs, held_record_invalid, key_algorithm_unknown, key_file_malformed, key_fingerprint_mismatch, key_id_mismatch, key_not_prime_order, key_not_valid_at_signing, key_revoked, key_status_unusable, key_window_unreadable, lab_dev_key, link_broken, pq_missing, registry_duplicate_key, sequence_duplicate, sequence_gap, signature_invalid, signature_malformed, signed_instant_unreadable, signed_metadata_missing, signed_payload_unreadable, signer_not_accepted.
  • aws_lib (the gate and KeyRegistry): act_hash_mismatch, chain_position_absent, cosignature_invalid, cosignature_malformed, cosignature_stripped, displayed_field_mismatch, exec_not_after_absent, key_algorithm_unknown, key_config_invalid, key_file_absent, key_file_malformed, key_file_unreadable, key_fingerprint_mismatch, key_id_mismatch, key_not_prime_order, key_not_valid_at_signing, key_public_key_malformed, key_revoked, key_status_unusable, key_window_unreadable, pq_missing, receipt_hash_mismatch, receipt_type_unexpected, record_malformed, registry_duplicate_key, registry_missing_key, signature_invalid, signature_malformed, signed_instant_unreadable, signed_metadata_missing, signed_payload_unreadable, signer_not_accepted, statement_id_mismatch, verifier_unavailable.

The corpus beside it (tests/vectors/conformance/, its README.md says how to read it) is run through all three checkers of this package by tests/test_conformance.py. CHANGELOG.md lists what changed from 0.2.1.

Tests

uv sync
uv run pytest -q

The tests run against an in-process fake of /v1 (tests/fake_requisition.py). The fake follows the cited code's rules: nonce claims and exact retry by body digest, the release members of every execute answer (release_id, and replayed: false on the first answer of a nonce claim, true on a retry), a single spend, and Ed25519-signed lab records. The tests never write to a running Requisition, and they need no Requisition checkout: what they use of Requisition is committed under tests/fixtures/, each folder with a PROVENANCE.md that names its source and sha256:

  • tests/fixtures/requisition/: Requisition's bin/lab-verify and the verify_receipt.py it runs, byte for byte, with their sha256 in that folder's PROVENANCE.md. The real bin/lab-verify checks records that the fake signed.
  • tests/fixtures/seed/: the lab seed whose display_schema is compared with the test copy.
  • tests/fixtures/verify_receipt_r4/: the source of the vendored Ed25519 routine.

What compares this repository with Requisition's own files (that the copies above are still Requisition's, the key-rule texts and vector file, the act hash over Requisition's vectors V1 and V2, which are never copied here because their arguments are effector material, and the published kit's record) runs in Requisition's test suite, where both trees are present.

The ML-DSA-87 verifier is checked against these vectors (provenance in tests/vectors/mldsa87/PROVENANCE.md):

  • NIST ACVP sigVer, ML-DSA-87 pure external, at ACVP-Server 975de31e.
  • All 241 Wycheproof ML-DSA-87 verify vectors at d17cc89f. They include tcId 21, the repeated hint (the class of CVE-2026-24850).

It is also compared with two other implementations:

  • cryptography's ML-DSA-87, live.
  • Erlang/OTP 28.5.0.8 :crypto over OpenSSL 3.5.9. The run is recorded in tests/otp/ and re-run when that toolchain is present.

The fake also produces four shapes that the Requisition version it follows (of 2026-10-26) does not have (the co-signature, the outcome record, the act_hash lookup and the propose idempotency key), behind newer_routes=True and cosign=..., and the tests label them that way.

No adoption through the act-hash lookup. That lookup answers every open request of the principal with the same act hash, whoever filed it (another gateway, the target, another caller). Since 0.2.1 the adapters never adopt such a request: Gate(adopt_open_requests=False) is the default, the interceptor, the target and the Strands hook refuse a gate with it on, and a gate built with it on says so at WARNING. A lost local store therefore files a new request (the old approval is asked for again).

tests/fixtures/elixir_differential/ holds answers from the compiled Requisition modules: 4,010 redactor strings and 1,500 encoder terms. PROVENANCE.md there records how they were made: plain elixir -pa, so no app started and no database was opened.

Running the demo

Preconditions, on the Requisition server the demo talks to (REQUISITION_URL):

  1. payments.refund_send is registered from Requisition's demo seed file, the set aws_demo (this repository's copy of it is tests/fixtures/seed/aws_demo.v1.json).
  2. A caller grant covers that act type at class high or above, with scope propose_execute.
  3. You have that grant's credential and principal.
cd requisition-aws
export REQUISITION_DEMO_DIR=/path/to/demo     # required: req/ is a Requisition checkout; transcripts go to log/
export REQUISITION_SEED=/path/to/seed.json    # required: the seed file the server registered the act type from
# export REQUISITION_LOAD_WRAPPER=/path/to/cmd # optional: a command placed before docker (--airgap)
export REQUISITION_URL=http://127.0.0.1:4000   # your Requisition server
export REQUISITION_CRED='rqc_...'        # never printed; elided from the transcript
export REQUISITION_PRINCIPAL='rqp_...'
# export REQUISITION_SOCKET=/path.sock   # only if the server runs with REQUISITION_LAB_SOCKET=true
uv run python demo/run_demo.py --scripted \
  --transcript "$REQUISITION_DEMO_DIR/log/demo-scripted.txt"     # no model
uv run python demo/run_demo.py \
  --transcript "$REQUISITION_DEMO_DIR/log/demo-live.txt"         # Bedrock

What each mode uses:

  • Live mode uses Amazon Bedrock openai.gpt-oss-120b-1:0 in us-east-1 through the AWS profile named by AWS_PROFILE (boto3's default chain when unset), with synthetic prompts only.
  • --scripted calls no model. It drives the same hook path, with the same interrupt and resume.

When the agent's tool call is held, the run prints APPROVE AT <REQUISITION_URL>/approvals. Two approver accounts approve in the console. The app polls GET /v1/sanction-requests/<id>, resumes, and the stub prints REFUND SENT only on a signed allow. The run then executes the same statement under a fresh nonce, which is a signed deny statement_spent. Finally it checks every record offline. Records, the pinned GET /v1/keys file and the store go to <transcript>-records/.

Check before the live run:

  • Time limits. The statement expires 300 s after the second approval. A row with sanctioners_required >= 2 takes the first time line. An allow's exec_not_after is at most 60 s after the decision.
  • The key file. cmp <records>/lab-keys.json "$REQUISITION_LAB_KEY_FILE" must report the same bytes.
  • The model. Whether gpt-oss calls tools through Strands' Bedrock provider is unverified. The model may also write a reason that the redactor refuses, such as anything containing sk- (task-, disk-) or "secret". The hook then cancels with the code, and nothing is proposed.

The dress rehearsal

export REQUISITION_DEMO_DIR=/path/to/demo     # as above; REQUISITION_LOAD_WRAPPER too, if you use one
# required: demo/rehearse.sh has no default and stops without it
export REQUISITION_SEED=/path/to/seed.json    # as above, required too; a dry run (REHEARSE_DRY=1) reads this
                                              # repository's copy when it is unset
export REQUISITION_URL=http://127.0.0.1:4000 REQUISITION_CRED='rqc_...' REQUISITION_PRINCIPAL='rqp_...'
export REQUISITION_LAB_KEY_FILE=...   # required: steps 1 and 3 refuse unless GET /v1/keys serves these bytes;
                                      # step 2 checks every signature against this file
demo/rehearse.sh                      # STRANDS_MODE=scripted to skip Bedrock
                                      # REQUIRE_PQ=0 against a server without co-signatures: with 1 (the default)
                                      # all three forms refuse, AT RUN TIME, any record without a checked
                                      # ML-DSA-87 signature, and the offline and airgap checks fail it
REHEARSE_DRY=1 demo/rehearse.sh       # a dry run: a local fake /v1 that auto-approves; no lab, no Bedrock

What each part does:

  • Each step stops at APPROVE AT until two approver accounts approve.
  • Full transcripts and records go to $OUT, by default $REQUISITION_DEMO_DIR/log/rehearsal-<UTC>/.
  • Step 4 runs docker after REQUISITION_LOAD_WRAPPER when it is set.
  • The offline check's and the airgap check's child processes get only PATH, HOME, LANG, LC_ALL, TZ, TMPDIR and the names listed in REQUISITION_CHILD_ENV (comma-separated, no spaces), never REQUISITION_CRED (the allow-list is the control); a variable holding its value is refused too, best-effort (a substring check: an encoded or split copy passes). The rollback demo's children get the same plus the PG* names, checked alike. A load wrapper that needs more (systemd-run --user: XDG_RUNTIME_DIR, DBUS_SESSION_BUS_ADDRESS; docker: DOCKER_HOST) needs those names listed there.

Requisition as the Gateway target (not deployed)

Why an MCP server target on AgentCore Runtime, not a Lambda target (AWS docs, fetched 2026-11-09, cited in mcp_target.py):

  • Lambda target. It receives only the tool arguments, plus gateway, target and request ids. AWS does not document how a returned error reaches the agent.
  • MCP server target. It returns its own CallToolResult, so "awaiting approval", a signed deny and "Requisition unavailable" each reach the agent as isError results.
  • Outbound auth. On Runtime the target takes IAM (SigV4) outbound auth, so the hop from the Gateway to the tool needs no stored secret.

The tool runs only on a checked allow, before its exec_not_after, and at most once per statement:

  • The run is claimed in the store first.
  • A Gateway retry of the same invocation returns the stored result. The tool does not run again.
  • Across instances, only the one whose execute answer said replayed: false runs the tool (see "One approval, one effect" under Limits). REQUISITION_ALLOW_SINGLE_INSTANCE_STORE=1 is required to start (the table below).
  • A crash mid-run leaves the claim. The call then fails closed and the tool does not run twice.

The interceptor's configuration (not deployed)

variable meaning
REQUISITION_URL, REQUISITION_CRED, REQUISITION_PRINCIPAL The /v1 caller.
REQUISITION_GATEWAY_ID This gateway's id, set at deploy. It is used instead of GATEWAY_ARN, which is documented for HTTP targets only.
REQUISITION_TOOLS JSON mapping {"<target>___<tool>": "<act type>"}. AWS's tool naming is ${target_name}___${tool_name}. A v2 act type that pins several tool digests takes {"act_type": ..., "tool_digest": "<this gateway's digest>"} (G2).
REQUISITION_CALLER_SOURCE sigv4 (the default since 0.2.1: the SigV4 access-key id of the forwarded Authorization), jwt (with REQUISITION_JWT_ISSUER, REQUISITION_JWT_JWKS_FILE, and REQUISITION_JWT_AUDIENCE and/or REQUISITION_JWT_CLIENTS), or legacy_session (the pre-G1 behaviour, unverified; only with the next row). Any other value refuses to start. See requisition_aws/caller.py.
REQUISITION_TARGET_CALLER_HEADER Default X-Requisition-Caller, an HTTP header name. An allowed tools/call passed on carries this header set to the interceptor's caller key (overwriting any value the client sent; a client value is never passed on), for the target's REQUISITION_CALLER_HEADER. The target does not verify it: it can trust it only when it accepts traffic solely from the gateway and the gateway's interceptor sets it. Neither is measured live.
REQUISITION_ALLOW_LEGACY_SESSION_CALLER 1 or 0; unset means 0. Required to start with legacy_session (and, on the target, to start without REQUISITION_CALLER_HEADER). The Mcp-Session-Id text is not a caller identity: a second caller sending the first caller's text spends the first caller's approval. With 1 it starts and logs UNVERIFIED CALLER at WARNING on every start.
REQUISITION_SEED The lab seed file holding each act type's display_schema.
REQUISITION_STORE The idempotency store path.
REQUISITION_ALLOW_SINGLE_INSTANCE_STORE Required to start today, on the interceptor and on the target: exactly 1. The store is one local file, seen by one instance (a Lambda execution environment, a Runtime microVM), and this package has no shared conditional-write store. Unset or 0, the entry point refuses to start (the Lambda refuses every call). 1 is for a local run or a demo, where one instance runs; it is logged at WARNING on every start. With several instances an approval still runs the tool at most once, but a retry that reaches another instance is refused there and needs a new approval, and the rollback memory (F1) is per instance.
REQUISITION_STORE_BACKEND The store's kind. file is the default and the only one built; any other value refuses to start. A shared backend would be added here (requisition_aws/store.py, BACKENDS) and would start without the opt-in above.
REQUISITION_AGENT The agent member of the arguments object.
REQUISITION_APPROVAL_BASE The console base URL used in approval links.
REQUISITION_KEYS_FILE Required. The pinned lab key file. Without it the handler refuses every call. Every statement and decision signature is checked against it, and an allow whose signature was not checked is never passed through.
REQUISITION_REQUIRE_PQ Default 1: every record must carry an ML-DSA-87 signature checked here (the record's own, or its co-signature). Set 0 only against a server without co-signatures.
REQUISITION_ALLOW_CLASSICAL_ONLY 1 or 0; unset means 0. 1 lifts the post-quantum policy of the evaluation environment's pinned key file.
REQUISITION_ALLOW_PLAINTEXT_PRIVATE 1 or 0; unset means 0. 1 allows http:// to a private or link-local IP literal (the VPC case). Otherwise REQUISITION_URL must be https, unless the host is loopback.
REQUISITION_TIMEOUT, REQUISITION_KEYS_MAX_AGE_SECONDS, REQUISITION_CRED_REREAD_SECONDS Seconds, written in decimal digits with an optional fraction (5, 0.5), above zero and at most 86400 (one day). Unset means 5, 300 and 60.
REQUISITION_PRINCIPAL_EXPECTED Required by the deployed Lambda entry (deploy/lambda/interceptor_entry.py): the principal id the caller secret must name, rqp_ and 32 lower-case hex digits. Unset, empty or in any other form, every request is refused before the secret is read. A stack template must pass a principal id here: an empty default refuses every call.

Known names only. The interceptor and the target refuse to start on a REQUISITION_* variable this package does not read (a misspelling such as REQUISITION_REQUIRE_PQQ), naming it; a name read by another form or a demo of this package is accepted, so one environment can serve them all. When REQUISITION_TARGET_CALLER_HEADER and REQUISITION_CALLER_HEADER are both set and name different headers, each warns at start.

Accepted values only. The switches above take exactly 1 or 0; unset, REQUISITION_REQUIRE_PQ means 1 and the others mean 0. Any other value refuses to start and names the variable; that includes true, yes, on, an upper-case word, a padded 1 and the empty string. A wrong spelling never falls back to the weaker setting. The same holds for the seconds and for REQUISITION_TOOLS, which is read as strict JSON (a tool named twice is refused). On the target, REQUISITION_CALLER_HEADER is required (unless REQUISITION_ALLOW_LEGACY_SESSION_CALLER=1); the target trusts that header as-is (it says so at WARNING on start), which is sound only when it accepts traffic solely from the gateway and the gateway's interceptor sets the header (unmeasured live). It and it and REQUISITION_SESSION_HEADER must be HTTP header names when they are set, and MCP_HOST must be a host name or an IP literal (unset: 127.0.0.1); set and empty is refused. REQUISITION_ACCEPT_SIGNERS is exactly any or lower-case signer labels joined by commas with no spaces (unset: kms; a padded any is refused, never read as any); REQUISITION_GATEWAY_ID and REQUISITION_TARGET_ID are printable ASCII without spaces; MCP_PORT is decimal digits, 1 to 65535. The deployed forms log the refused variable and what it accepts, never its value.

When the caller is verified. The sigv4 default is a verified caller only on an AWS_IAM gateway with passRequestHeaders: true (the Gateway checked the SigV4 signature and forwards the original Authorization; this function holds no secret to check it). jwt is verified here against the pinned issuer and JWKS. And on a gateway whose inbound authorizer is NONE, no caller source is verified except jwt's own check: any header is accepted by the Gateway, and the interceptor cannot tell which authorizer it is behind (no code check is possible). Keys: sigv4:<access key id>; jwt:<issuer>|sub:<sub> or jwt:<issuer>|client:<client_id> (a token without sub).

The interceptor needs passRequestHeaders: true. Without the caller's header (Authorization under sigv4 or jwt, Mcp-Session-Id under legacy_session), it refuses every tools/call with caller_identity_absent, fail closed.

Every tools/call logs the names of the request's headers, never their values. Whether the Gateway forwards the SigV4 Authorization under AWS_IAM has not been measured yet. Until one live call shows it, a deployment on the default (sigv4) may refuse every tools/call with caller_identity_absent (availability, not safety). The 0.2.0 default legacy_session let one caller spend another's approval and now starts only acknowledged.

Methods are denied by default. Only initialize, ping, notifications/*, tools/list and server/discover pass through. Every other method gets JSON-RPC -32601, including resources/*, prompts/*, completion/complete, subscriptions/listen and logging/setLevel.

Each method on it is one an agent needs in order to call a gated tool, and none of them reaches an effect. The cost: a 2026-07-28 client cannot subscribe to list_changed notifications through this Gateway (subscriptions/listen), so it has to list again.

For a v2 act type that pins tool digests (G2, requisition_aws/catalog.py):

  • The RESPONSE interception point on tools/list withholds a drifted tool and marks it. The mark is keyed by gateway id, tool and pin, so a re-pin (a new registration, which two approver accounts approve) is not blocked by the old pin's mark.
  • A later call to a marked tool is refused. A marked tool is also withheld from every later listing.
  • Only the operator clears a mark: python -m requisition_aws.catalog --clear-mark <gateway-id> <tool> --store PATH Each clear is appended to catalog_marks_cleared as <mark key>:<n> and never overwritten. Clearing approves nothing. The tool waits as catalog_recheck_pending, and calls are refused, until the next tools/list re-checks it: a tool still drifted is re-marked, and the registered definition is served.
  • The deployed gateway has no RESPONSE point yet. Adding it is part of deploy/gateway/g12-change-set.sh, run by the operator of the Gateway's stack.

The fixtures under tests/fixtures/interceptor/ are each labelled "AWS documented shape, fetched 2026-11-09, not a live Gateway", with their source URLs.

Limits, stated

  • Authorization, not execution. The record proves the act was authorized once. It does not prove that it ran.
  • The key. The demo key is a lab key served by the lab. It is not a trust root: bin/lab-verify says DEGRADED (lab), verdict_code: lab_dev_key, exit 8 (a status of its own; before 0.3.0 it was 5, the status of an answer about trust, so a caller that branched on the status could not tell them apart). bin/verify_offline.py accepts a lab pass only with exit 8, so it fails closed with an older lab-verify.
  • The hook form. The Strands hook runs in the agent's own process, so a compromised agent can skip it. The interceptor and target forms do not have this weakness.
  • Spend before effect. A statement spent in a REQUEST interceptor stays spent even if AgentCore Policy then denies or the target fails. Only the target form binds the spend to the effect.
    • At most one pass-through per statement, always. The interceptor writes a durable "passed" mark per statement before it passes a call through. Any later invocation that resolves to the same statement is refused with "this approval was already used; a new call needs a new approval": a client reusing its JSON-RPC id, a Gateway retry, anything. Requisition answers an exact execute retry with the stored allow and no spend check, so within one instance this mark is what stops a replay.
    • A Gateway retry after a timed-out first pass-through is therefore refused (fail closed). The approval may be lost and the agent must file again. Only the target form binds the spend to the effect.
    • exec_not_after is checked on every allow, replayed or not.
  • One approval, one effect, across instances. Requisition answers an exact retry of an execute with the same signed allow. Two unsigned members of the answer say which answer is the first: release_id (the nonce claim, also the decision's signed subject_id) and replayed (false once, then true). All three forms act on an allow only when their own store holds its first release, and a store takes a release only from an answer that says replayed: false, keyed on the pair (release_id, the decision's receipt hash):
    • two instances of one deployment that receive the same approved call in the same second send the same bytes; one is answered replayed: false and acts, the other is answered replayed: true and refuses (allow_already_released);
    • an allow whose answer has no boolean replayed (absent, "false", 0, null), no release_id, or a release_id that is not a nonce claim id as Requisition issues them (a lower-case UUID) is refused (release_unstated), and one whose release_id is not the signed nonce claim is refused (release_mismatch). A Requisition server that does not send these members is therefore never acted on. The client reads at most 1 MiB of an answer (the largest legitimate one measured is under 16 KB); a longer one is refused unread;
    • a retry in the same instance still works exactly once: its store holds the release, and the single-use claim decides. That includes a retry after a local step failed on the first answer (reading the key file, writing the position memory): the release is recorded before those steps. It is recorded under the decision's receipt hash and counts only for a decision of that hash whose signature then verifies, so an answer whose signed payload is not the genuine one leaves nothing a later one can use: its release is another payload's, a row of its own, and it does not stand in the way of the genuine first answer either (also in a store shared by several instances). What such an answer can still write is bounded: one small row per answer read;
    • what this costs: allow_already_released is final for that call, and the call needs a new approval. Its causes, which an instance cannot tell apart: another instance received the first release (also when that instance stopped before the tool ran); the first answer never arrived (lost in transit, or the instance stopped before reading it); it arrived altered; it was refused before its release could be recorded (it did not bind what was sent, or the store could not write); or the store that held the release was lost since (a new Lambda environment or microVM);
    • replayed is not inside the signed decision. Whoever can alter the answer between Requisition and the adapter can turn true into false, and with per-instance stores one approval then has two effects: the instance whose genuine retry answer was altered acts on it. Garbling the signature as well changes only when: that answer is refused, but it carries the genuine payload, so it records the genuine release in that instance's store, and its next untouched retry acts (two effects again; the tests pin both). With a store shared by every instance, the single-use claim stops the second effect. TLS to Requisition is what stands against all of this; with REQUISITION_ALLOW_PLAINTEXT_PRIVATE=1 (plain http to a private address) nothing does.
  • Removing the interceptor. Anyone with UpdateGateway can remove the interceptor, and then calls leave no record at all. Detecting the absence rests on the outcome record (POST /v1/outcomes).
  • The store. The idempotency store is one local file:
    • the single-use claims (the interceptor's "passed" mark, the hook's and the target's "ran" claims, each taken before the effect) are per host;
    • a Lambda's /tmp is per execution environment;
    • a deployment on AWS needs a durable conditional-write store; none is built here. The interceptor and the target therefore refuse to start unless REQUISITION_ALLOW_SINGLE_INSTANCE_STORE=1 says the file store is meant (one instance: a local run, a demo). The Strands hook has no entry point of its own: the application builds its store.
  • Approvers. The demos' acts are approved by two separate accounts ("two approver accounts"), held by one person in the lab (the signed records' hands member says so). Web sign-in has no second factor.
  • Single use. In Requisition's evaluation environment, where its execute API runs, single use holds within one database, not across a restore or clone, and that stays open at Requisition. F1 (fence.py) adds a refusal by the executor that already acted, with its store intact: after a rollback the restored service re-mints the approval under a new statement id, and that executor refuses it (authority_equivocated when the re-mint lands at a position it holds, approval_already_used otherwise). Not covered:
    • a different executor with its own store never saw the first use (open until decisions name their one audience);
    • the deployed Lambda interceptor and the AgentCore Runtime target make NO rollback claim: their store is /tmp, per execution environment or microVM, so the memory is lost with it (until their store is durable). The claim holds for the Strands hook and the local target and interceptor runs, whose store survives;
    • the evidence is two records signed by the lab key at one position: it shows that the holder of that key signed two histories (lab profile), not a general proof of rollback.
  • The outcome record. The outcome record is the caller's report, not proof that the effect happened. The target form is the one that binds the effect to the allow, because the tool runs inside the target.
  • The ML-DSA-87 check. The vendored verifier checks only ML-DSA-87, pure, with an empty context. Both of the lab's keys are dev keys, not trust roots.
  • The approval link. GET /v1/sanction-requests/:id does not return the approval request id while a request is pending. Until the statement exists, the link is the console's /approvals list.

About

AWS adapters for Requisition: Strands hook, AgentCore Gateway interceptor and target, offline checks

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages