Skip to content

feat(id-caps): agent identity, role binding, UCAN-style delegation spike (#7915) - #11206

Merged
dezren39 merged 1 commit into
mainfrom
queue/20045-7915-spike
Nov 17, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/20045-7915-spike

Conversation

@dezren39

@dezren39 dezren39 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Spike 3/5 for #6300 — agent identity, roles, UCAN-style attenuated delegation

Implements issue #7915 per doc/2026-11-09_design_id6300_agents_in_worlds_v1.md §5, §9.2, §9.4 (design delivered by PR #7911). New self-contained module id_caps::agent_delegation (pkgs/id/crates/id-caps), reusing the existing WorldScopes capability set. Nothing existing is modified beyond the one-line module registration.

What lands

  • Agent identity (§5.1): AgentId is the agent's own Ed25519 public key (the iroh endpoint ID); the key alone grants nothing.
  • Role binding (§5.2): Role = capability ceiling + worlds + lifetime; RoleBinding is the owner's Ed25519 signature binding an agent key to a role in one world.
  • Delegation (§5.2): Delegation::issue mints depth-1, expiring, offline-verifiable tokens; scopes must attenuate the binding ceiling (checked at issuance and re-derived at verification, so even an owner-signed widened token fails).
  • Lifetime & renewal (§5.3, §9.2): 1 h default; role lifetimes bounded to 15 min – 4 h; Delegation::renew succeeds only for the binding owner's key — the agent cannot renew its own token (stopping renewal is revocation).
  • Join verification (§5.2, §7): verify_join re-derives every check from the two signatures (binding signature, issuer = owner, depth = 1, world/role/agent match, delegation signature, ceiling, expiry); verify_join_audited also emits the §7 audit event (agent, owner, world, tool, proof reference, outcome) for grants and refusals.
  • Hosted edge (§5.4, §9.4): EdgeScopes parses world:<id> role:<name>; authorize_edge re-derives authority from binding + chain — a valid transport token with no matching role binding grants nothing.

Acceptance tests (oracle: the design doc)

cargo test -p id-caps agent_delegation — 8 passed:

  • join without a valid chain is refused and audited (§5.2, §7)
  • valid chain grants exactly the delegated scopes (§5.2)
  • widened token fails verification; issuance refuses to mint it (§5.2, §4.5.1)
  • re-delegated (depth-2 / agent-signed) token fails (§5.2)
  • expired token fails (§5.3)
  • renewal is owner-client-only (§5.3, §9.2)
  • lifetime bounds enforced, 1 h default (§9.2)
  • hosted edge: valid token, no role binding → grants nothing (§5.4, §9.4)

Full id-caps suite: 147 passed, 0 failed. cargo fmt clean. (Clippy could not run in this worktree: the shared target cache was built by an incompatible rustc — E0514 on dependency crates, unrelated to this change.)

Assumptions / scope notes

Queue task 20045, lane any-n.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…ike (#7915)

Spike 3/5 of the #6300 agents-in-worlds design (doc sections 5, 9.2, 9.4): Ed25519 agent identity (endpoint ID = public key), owner-signed role bindings, depth-1 attenuated delegations with 1h default lifetime (15m-4h role bounds), owner-client-only renewal, offline verify_join with section 7 audit events, and the hosted-edge rule that a valid transport token without a role binding grants nothing. Eight acceptance tests name their design-doc oracle; full id-caps suite green (147).
@dezren39
dezren39 requested a review from a team as a code owner November 17, 2026 10:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T10:11:59.089680Z
We couldn’t complete this review. Comment @codex review to try again.
5848013 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 206cc719-bc53-4c98-8a65-e6308819d83b
Commits

Reviewing files that changed from the base of the PR and between 19bccbd and 5848013.

Files selected for processing: 2

  • pkgs/id/crates/id-caps/src/agent_delegation.rs
  • pkgs/id/crates/id-caps/src/lib.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

@codex review

Spike 3/5 for #6300 (issue #7915): agent identity, role binding, and UCAN-style attenuated delegation in a new id_caps::agent_delegation module, per design doc sections 5, 9.2, 9.4. Please focus on the verification path (verify_join): signature checks, attenuation re-derivation, depth-1 enforcement, expiry, and the hosted-edge rule that transport validity alone grants nothing.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit 954ef93 into main Nov 17, 2026
1 check passed
@dezren39
dezren39 deleted the queue/20045-7915-spike branch November 17, 2026 10:14
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