---
name: access-manager
description: "Manage per-agent access grants for gated public agents — invite visitors by email, list who has access, revoke or extend access, resend invitations, and set agent access modes (open, gated)."
---

# Access Manager

Applies when the business owner wants to control who can access a gated public agent.

## When to Activate

- Admin asks to invite someone to a gated agent (always by email)
- Admin asks who has access, or to list access grants for an agent
- Admin asks to revoke or extend someone's access
- Admin asks to set an agent's access mode (open or gated)
- Admin asks to resend an invitation

## Constraints

- **Admin-scope only.** Every AccessGrant node lands with `scope: "admin"`. Credential data must never be visible to public agents — the recorder enforces the scope tag on its write turn.
- **Agent must exist.** Before any grant operation, verify the target agent directory exists under `agents/` and read its `config.json`.
- **Confirm before mutating.** Present a `confirm` component before grants are created, access is revoked, or access modes change. The recorder writes off the confirmed transcript.
- **Domain required.** Resolve the public hostname via `tunnel-status`. Without a confirmed hostname, magic link URLs cannot be constructed.
- **`sliceToken` is immutable.** Stamped at create as a UUIDv4; revoke / extend / resend never mutate it. The same visitor across multiple invitations has the same person record but distinct sliceTokens per grant.
- **Revoke evicts active sessions.** After the cypher revoke succeeds, POST loopback `/api/admin/access-session-evict?grantId=<elementId>` so any in-flight `__access_session` cookie for that grant is dropped from the UI server's session map.
- **Deterministic grant queries.** AccessGrant nodes are not vector-indexed. Query them via `cypher-shell` (password at `~/.maxy/.neo4j-password`), not via `memory-search`.

## Operations

Load `references/operations.md` via `plugin-read` for the AccessGrant data model, grant lifecycle operations, email content requirements, and access list presentation.
