agentId. The SDK obtains and refreshes it automatically. You don’t write any of this code yourself.
What the identity gives you
The signed identity is a 60-minute token that the SDK presents on every call to Rubric. Two properties matter:- Stable agent id. Audit ingest, trace upload, and bundle reads all assert the agent id against the body of the request — an agent can only ship attribution for itself. There is no way to forge another agent’s events.
- Auto-rotating. The SDK refreshes the token ahead of expiry. Your code never sees an auth error from a normal expiry.
How the SDK bootstraps
Enrollment is the only bootstrap path. You mint a long-lived, register-only enrollment token in the dashboard and drop it into your agent process as an environment variable. On startup the SDK presents the token plus anagentName, and Rubric mints a fresh signed identity for that agent.
- Idempotent on
agentName— the same(org, agentName)always resolves to the same agent identity. Restarts and redeploys don’t pile up identities; only the short-lived signed token rotates. - Register-only — a leaked enrollment token cannot ship audit events or read bundles. Worst case: an attacker creates new agent rows in your org. Bounded, auditable, revocable per-token.
- Rate-limited — each token has a
maxEnrollmentsPerHourcap (default 60). Brute-force protection. - Expires — 90 days by default; renewable from the dashboard with a successor token.
Lifecycle
Bootstrap
SDK reads
AG_ENROLLMENT_TOKEN and AG_AGENT_NAME from env, exchanges them for a freshly-minted signed identity.Auto-refresh
The SDK schedules a refresh at ~50 min into the token’s lifetime. The agent never sees an auth error from a normal expiry.
Revocation
Operator clicks Revoke on an identity in the dashboard. The current token keeps working until expiry (max 60 min). Refresh attempts and new enrollments for the same
agentName are rejected — operator must un-revoke or rename.Naming
agentName is what you pass to bootstrap(agent_name=…). Rubric normalizes it into the agent’s stable id (lowercase, dash-separated, max 128 chars).
Choose names that:
- Identify the role, not the host.
payments-bot,customer-support-router— notagent-prod-us-east-1c. - Survive redeployment. The whole point of idempotent enrollment is that
payments-botv2 inherits v1’s identity. - Differ across environments. Use a suffix or a separate org per environment:
payments-bot-stagevspayments-bot-prod.