Repository navigation
Add runtime-authority gate reference implementation, SDKs, specs, CI, and governed-workflow hardening - #33
Conversation
…t-trust-infrastructure-jq0jmq
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6bfe8b1e29
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -303,35 +368,76 @@ const server = http.createServer(async (req, res) => { | |||
| receipt.decision.latencyMs = Date.now() - started; | |||
There was a problem hiding this comment.
Recompute integrity hash after setting latencyMs
buildReceipt computes integrity.hash before returning, but /re/authorize mutates the signed payload at receipt.decision.latencyMs immediately afterward. This makes every authorization receipt internally inconsistent (hash no longer matches receipt contents), so downstream verification/audit code will fail even for untampered receipts.
Useful? React with 👍 / 👎.
| }; | ||
|
|
||
| const receipt = buildReceipt(syntheticRequest, decisionResult); | ||
| receipt.integrity.chainHash = priorReceipt.integrity.hash; |
There was a problem hiding this comment.
Re-hash receipt after overriding reauth chain hash
In /re/reauthorize, the receipt hash is generated inside buildReceipt, then integrity.chainHash is overwritten afterward. Because the hash is not recomputed, reauthorization receipts are emitted with invalid integrity metadata and cannot be reliably chain-verified.
Useful? React with 👍 / 👎.
| const decisionResult = approved | ||
| ? { | ||
| outcome: 'PERMIT', | ||
| mode: 'CONSTRAINED', |
There was a problem hiding this comment.
Reject reauthorization for non-step-up outcomes
The reauthorization path issues PERMIT whenever approval.approvedBy is present, without validating that the prior receipt was STEP_UP or ESCALATE. This allows a previously DENY decision (for example, low trust or policy violation) to be converted into a permitted execution by calling /re/reauthorize with that receipt ID, effectively bypassing deny controls.
Useful? React with 👍 / 👎.
Motivation
POST /re/authorizeand handle receipts.Description
reference-implementations/runtime-authority-gate/server.mjsthat evaluates trust/risk/cost/compliance, emits structuredExecutionReceipts withintegrity.hashandchainHash, and exposes endpointsGET /healthz,POST /re/authorize,POST /re/reauthorize,GET /receiptsand/utils/binding-hash.sdk/node/index.js,sdk/node/models.js) and Python SDK (sdk/python/client.py,sdk/python/__init__.py) plus READMEs and usage examples for each language.specs/anddocs/includingscim-re-authorize-api.md,execution-receipt.md,rap.md,ttp.md,trust-decay.md, and administrative and user guides and examples inexamples/..github/workflows/ci.ymlto runnpm test, compile the Python SDK (python -m py_compile sdk/python/client.py), and perform end-to-end smoke checks usingcurl, the Python SDK and the Node SDK against the reference gate; and updategoverned_execution.ymlto serialize changed files robustly, return local fallback receipts when no changes or config is missing, surface step-up results, and treat specific local receipts as no-op or non-fatal.package.jsontest scripts to run the newruntime-authority-gatetest suite and add a top-levelCHANGELOG.mdand README rework to reflect the BlockSiFr Agent Trust Infrastructure baseline.Testing
npm testwhich executestest:trust-routingandtest:runtime-authority-gate, and the suites completed successfully.reference-implementations/runtime-authority-gate/server.test.mjs, which exercisedGET /healthz, multiplePOST /re/authorizescenarios,POST /re/reauthorize,GET /receipts, andPOST /utils/binding-hash, and all assertions passed.python -m py_compile sdk/python/client.pysucceeded, and the smoke flows that call the running gate viacurl, the Python SDK, and the Node SDK validatedPERMITresponses and returned receipts successfully.Codex Task