Skip to content

feat: workflow-scoped capability tokens for agent-to-agent calls #948

Open

Description

@vybe

Summary

Issue ephemeral capability tokens scoped to a correlation_id (one workflow) with a TTL matching the workflow deadline, replacing permanent permission grants for agent-to-agent calls. When the workflow completes, the token expires. Bounds the blast radius of a compromised agent to its active workflows, not its permanent permission set.

Context

docs/planning/TARGET_ARCHITECTURE.md §"Zero-Trust Agent Network" describes the destination: today agent_permissions correctly enforces default-deny at the MCP layer, but a granted permission is permanent. A compromised agent can replay its credentials across all workflows it was ever allowed to participate in.

Workflow-scoped tokens are additive — they layer on top of agent_permissions, they don't replace it. The permission table answers "is this pair ever allowed?"; the token answers "is this pair allowed right now, for this workflow?"

Sequencing: both original gates are discharged (closed 2026-07-08) — see the Technical Notes. correlation_id is now specified, and the pull direction that determines this feature's shape is committed. What remains is prioritization, not a dependency.

Acceptance Criteria

  • Design document under docs/planning/ covering:
    • Token format (JWT? opaque? signed envelope?) and where the signing key lives
    • Issuance trigger — when does Agent A's call to Agent B mint a token; when does the token reach Agent B
    • TTL strategy — workflow deadline, max ceiling, refresh policy if any
    • Revocation — explicit correlation_id block-list, or expiry-only
    • Audit — every issuance and use logged via the existing audit chain
  • Prototype on the MCP path: chat_with_agent mints a token tied to the current correlation_id, target agent validates it
  • Permanent agent_permissions grants remain the prerequisite — a missing permission denies the call before a token is ever issued
  • Demo: revoke a workflow mid-execution; subsequent agent-to-agent calls fail; calls outside that workflow continue working

Technical Notes

🤖 Generated with Claude Code

Activity

  1. added
    priority-p3
    type-feature
    security
    on May 26, 2026
  2. Keesan12 commented on May 26, 2026

    @Keesan12

    This looks like a coordination or scheduling contract issue. I’d make the envelope or schedule semantics visible in one place before layering on more behavior. The cleanest fix is usually to place the budget or attribution check before the expensive work, so the next retry has a clear signal instead of a surprise. That keeps the fix reviewable and avoids trading one hidden failure for another. If this is useful, I can help turn it into a compact repro checklist or PR shape.

  3. added
    theme-security
    on Jun 3, 2026
  4. added
    complexity-high
    status-incubating
    on Jun 12, 2026
  5. self-assigned this
    on Jul 3, 2026
  6. added a commit that references this issue on Jul 26, 2026
  7. removed
    security
    on Aug 4, 2026
  8. obasilakis commented on Aug 6, 2026

    @obasilakis
    Contributor

    Updated the body to drop two stale blockers. Both were named in the original description (@vybe) and both closed on 2026-07-08:

    Original text kept as strikethrough rather than deleted, so the reasoning stays legible.

    Added in its place as a note, not a new gate: #1081 Phase 4 (sync edge adapter for /chat and chat_with_agent) is not started, and that is the carrier an agent→agent capability token would ride — worth designing against Phase 4's shape rather than today's synchronous MCP call.

    No change to scope or acceptance criteria. Still P3 status-incubating — nothing blocks it now, it's a prioritization call.

  9. vybe commented on Sep 24, 2026

    @vybe
    ContributorAuthor

    Ruling 2026-09-24: stays incubating as stage 2 of the permission-layers plan. A workflow-scoped token is one implementation option for per-playbook grants (trinity-enterprise#590), not their prerequisite — the platform fronts every agent-to-agent call, so the grant can be checked server-side on the mediated call. Cross-referenced on #590.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-highpriority-p3status-incubatingtheme-securitytype-feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions