Skip to content

Agent access routes - #68

Open
dcmcand wants to merge 1 commit into
slice/agent-tokens-15-wiringfrom
slice/agent-tokens-16-routes
Open

dcmcand wants to merge 1 commit into
slice/agent-tokens-15-wiringfrom
slice/agent-tokens-16-routes

Conversation

@dcmcand

@dcmcand dcmcand commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Slice 16: Agent-access routes

A person can see and turn off their own agent access, and an admin can look up, revoke and allow again another person's, from a browser session only, with audit rows and never a token in a response.

Spec: nebari-dev/tapas/docs/superpowers/specs/2026-11-30-agent-token-broker-design.md
Plan: nebari-dev/tapas/docs/superpowers/plans/2026-12-01-agent-tokens-and-frames.md (Slice 16)
Contracts touched: GET /api/auth/agent-access, DELETE /api/auth/agent-access, DELETE /api/admin/people/{name}/agent-access, DELETE /api/admin/people/{name}/agent-access/block, GET /api/admin/people/{name}/agent-access, authn.sessionOnlyRoutes gains the agent-access paths
Depends on: #67

  • Own routes: {enabled, active, blocked, since}; revoke until next sign-in (204 either way).
  • Admin routes (RegisterAdmin, ActAdminConsole): look up, revoke and block until allowed, allow again; {name} is the identity name.
  • Session only, twice: sessionOnlyRoutes and a check in each handler. No token or sealed value in any body. Audit rows from the broker.
  • Switch off: enabled: false, nothing read or changed.
  • ui/openapi.json and ui/src/api/ regenerated.

Validation

Step Command / action Expected Result
unit go test -count=1 ./internal/gateway/... ok, parity test unmodified ok
openapi make openapi && cd ui && pnpm gen:api && git diff --stat ui/openapi.json and ui/src/api/ change; committed regenerated and committed
ui cd ui && pnpm typecheck && pnpm test ok typecheck ok; pnpm test locally times out in unrelated files under parallel load (they pass alone); this PR's UI workflow is the check
local make test-local ok exit 0

Five routes let people and admins manage agent access from a browser
session:

- GET and DELETE /api/auth/agent-access: a person sees whether their
  coding agents can act for them, and turns that off until their next
  sign-in.
- GET, DELETE and DELETE .../block under /api/admin/people/{name}/
  agent-access: a platform admin looks up a person's agent access,
  revokes it until they allow it again, and allows it again.

Every route refuses API tokens of any scope, both in the session-only
list and in each handler, and no body ever carries a token. Revokes and
blocks go through the broker, which writes the audit rows. With the
switch off the routes answer enabled false and change nothing.

A wiring test now checks that a service's minTokenScope reaches the
broker. The OpenAPI document and the UI's generated client are
regenerated. contracts.md and the plan's evidence, checkpoint review and
deviations are updated.

This branch has not been deployed

No deployments
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