Skip to content

fix(startup): policy acceptance before sealed-key provisioning (#782 companion) - #3

Closed
dinakarjs wants to merge 1 commit into
review/779-dd07facfrom
fix/782-policy-before-seal
Closed

dinakarjs wants to merge 1 commit into
review/779-dd07facfrom
fix/782-policy-before-seal

Conversation

@dinakarjs

@dinakarjs dinakarjs commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Superseded by the revised upstream draft agentrust-io#840 after agentrust-io#779 merged and review identified later startup refusals. Keep agentrust-io#840 as the canonical review venue. This historical policy-only candidate is not the complete fix. The separate lifecycle controls in #5 remain separate.


Problem and change

A rejected policy bundle can leave a first-start signing key sealed to the rejected configuration. This companion to agentrust-io#782 moves provisioning/unseal after the existing policy verification, while retaining early public-key discovery for the attestation nonce. It also clarifies the empty-owner-password/device/store access boundary in the module and security-model documentation, and corrects the configuration-digest migration scope.

Based exactly on parent PR agentrust-io#779 at dd07fac. This is an adoption candidate for the assigned owner @rajnisht7 and parent author @Yatsuiii, not a competing upstream PR. Do not merge this frozen review base into upstream main; cherry-pick the correction onto the selected branch or submit it after agentrust-io#779 lands.

Validation

Linux / Python 3.11.17, reused development environment, explicit checkout PYTHONPATH:

  • Full unit suite: 2521 passed, 8 skipped.
  • Focused startup/sealing/policy selection: 157 passed, 1 skipped.
  • All four new cases fail behaviorally with original startup.py restored: wrong hash, malformed manifest, invalid signing key, and valid-policy ordering. Fixed startup passes all 33 startup tests.
  • Ruff src/tests, mypy runtime/verify (77 source files), Bandit and whitespace checks pass.
  • Base tracked files matched the remote parent tree; all five published modified blob hashes match local files.

The first full-suite attempt ended with a native-library 'lookup self' error. The session-close file then passed 41/41 alone. A complete retry had nine failures caused by inherited SOCKS proxy configuration without socksio. The final complete run removed proxy environment variables for that test process only and passed. No dependency or application workaround was committed.

Evidence limits and security impact

Tests use the real policy loader with synthetic TPM seams. No fresh lock installation, swtpm/hardware execution, hosted CI, independent review or deployed recovery claim. The change prevents the finish/provisioning call on the covered policy refusals; early store locking and measurement still occur. This does not establish an atomic measured-policy snapshot or address later startup failures, and it does not alter TPM policy, key rotation, or evidence semantics. Optional reseal/rotation unit additions from agentrust-io#782 are outside this companion.

Signing-key lifecycle changes require the security review and two independent maintainer approvals before upstream acceptance. Parent ownership and existing review gates remain. No issue closure or merge requested by this draft.

DCO and assistance

Signed-off-by: Srinivasa Dinakar Jainti [email protected]
Prepared with OpenAI Codex. The source contract is the existing agentrust-io#782 report and agentrust-io#779 startup/sealing implementation; no new cryptographic mechanism is proposed.

Defer provisioning/unseal until policy verification succeeds. Add refusal
and accepting controls through the real loader with synthetic TPM seams.
Clarify empty-owner-password access and config-digest upgrade scope.

Refs agentrust-io#782; author-adoption companion to agentrust-io#779.
Prepared with OpenAI Codex.

Signed-off-by: Srinivasa Dinakar Jainti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant