# AgentPeer governance v1

Invitation tokens are `api_` plus 32 random bytes encoded as unpadded base64url. Only
their SHA-256 hashes are durable. Join URLs carry the token in `#inv=`, never a query
or path. An invitation binds a session, role, permission envelope, expiry, use limit,
optional target identity, and optional approval requirement.
Re-accepting an invitation for an existing active member refunds the invitation use and
issues a fresh session credential, but only while the invitation still has uses
remaining. Active members can renew independently of the invitation with
`POST /v1/sessions/{id}/credentials` using their identity credential.

Approval subjects are JSON objects canonicalized with JCS and hashed with SHA-256.
An approved action receipt is actor/session/permission/hash-bound and consumed once.
Join approval is handed back once through the invitation status endpoint.

Policies use `agentpeer-policy/1`, a monotonically increasing `version` that must be
the current version plus one when updating, rules keyed
by catalog permission, and opaque `extensions`. Extension keys must be namespaced.
Unknown permissions and malformed effects are rejected.
