Skip to content

feat(governance): standing-grant revocation dashboard (#620) - #638

Open
cagdasyurekli wants to merge 1 commit into
andrewyng:mainfrom
cagdasyurekli:feat/issue-620-standing-grant-revocation
Open

feat(governance): standing-grant revocation dashboard (#620)#638
cagdasyurekli wants to merge 1 commit into
andrewyng:mainfrom
cagdasyurekli:feat/issue-620-standing-grant-revocation

Conversation

@cagdasyurekli

Copy link
Copy Markdown

Summary

Closes #620.

Adds a centralized standing-grant revocation mechanism and Settings -> "Active grants" dashboard across the entire ladder of earned autonomy:

  1. Workspace Trust: Added explicit revoke_trust() method on WorkspaceTrustStore mirroring RiskOverrideStore:revoke_trust. Audited workspace trust changes (workspace_trust_granted and grant_revoked).
  2. MCP Per-Tool Trust: Audited revoke_mcp_trust in audit store (stage='grant_revoked', status='revoked').
  3. Standing Automation Rules: Audited task rule revocations in update_automation.
  4. Session Grants: Added revoke_tool_for_session, revoke_command_for_session, revoke_domain_for_session, and revoke_readonly_for_session to PermissionEngine and handled in-memory and persisted SessionRecord.grants updates.
  5. Egress / Allowed Domains: Added domain revocation across live engines and user config.
  6. Backend Query & REST APIs:
    • GET /v1/grants: Lists all active standing grants with metadata, source session/task, and details.
    • POST /v1/grants/revoke: Single endpoint to revoke any grant and record audit event.
  7. GUI Dashboard:
    • Added "Active grants" tab under Settings with filtering by kind (Workspaces, MCP Tools, Automations, Sessions, Domains) and one-click Revoke action.
    • Added English and Chinese locale translations.

Verification

  • Added tests/test_grants.py covering store methods, engine session revocations, manager listing/revocation, audit events, and REST endpoints.
  • Verified with pytest: 8 passed in tests/test_grants.py.

- Add explicit revoke_trust method to WorkspaceTrustStore mirroring RiskOverrideStore
- Add revoke session grant methods in PermissionEngine (tools, commands, domains, readonly)
- Add list_active_grants and revoke_grant to SessionManager across workspace trust, MCP tool trust, standing automation rules, session grants, and allowed domains
- Record audit events (stage='grant_revoked', status='revoked') for all grant revocations and workspace trust changes
- Expose GET /v1/grants and POST /v1/grants/revoke in FastAPI server
- Add Active grants tab and revocation section in SettingsView
- Add comprehensive unit tests in tests/test_grants.py
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.

[Feature Request] Standing-grant revocation dashboard

1 participant