Agent Credentials
Two ways to give an AI agent a credential. A service account belongs to the workspace and outlives any member. A sub-grant belongs to a member and ends when the member is removed.
Two paths
An agent that calls a Syncropel instance over HTTP needs a credential. There are two ways to give it one, and they answer to different failure modes:
| Service account | Member sub-grant | |
|---|---|---|
| Belongs to | The workspace | A member's access |
| Survives the member leaving | Yes | No. It ends with the member. |
| Access limit | Whatever scopes you give it | Can only be narrower than the member's own access |
| Right for | Workspace services: CI, dashboards, importers, standing automation | An agent acting on behalf of a person |
To choose, ask: if this person leaves, should the agent keep working? For the workspace's own services, yes: use a service account. For "my coding agent, spending my budget, acting under my authority", no: use a sub-grant, which ends automatically.
Path A: instance-level service account
Create a dedicated service account with the narrowest scopes that cover the agent's job, mint a bearer, and hand it to the agent as an environment variable:
spl service-account create \
--name "importer-agent" \
--actors did:sync:agent:importer \
--scopes records:read,records:write \
--with-tokenThe agent sends Authorization: Bearer <token> on every call. You can rotate or revoke each token or account separately. See Agent integration and Service accounts for details.
Because this credential belongs to the workspace and not to any member, removing a member never affects it. That suits a shared importer. It is a risk for a personal agent, which is what Path B is for.
Path B: an agent as a slice of a member
A member's access is a grant, and a grant can be narrowed when it is passed on. An agent credential here is a sub-grant of the member's access: it carries some of the member's scopes, plus limits you choose:
max_depth: how many further levels of delegation the agent may create below itself (0 means none).max_fanout: how many sub-grants it may issue directly.budget: a spend ceiling.
A sub-grant can only narrow what the member holds, never widen it. The chain of authority is recorded, so you can always answer "why can this agent write here?" by tracing back to the membership.
The key guarantee: every credential under a membership ends with it. Removing the member ends their agents' credentials in the same step. spl member revoke <label> reports what it ended (credentials and sub-grants), and the agent's next request gets 401 GRANT_REVOKED. No orphaned agents are left to clean up.
Mint a sub-grant for your agent with one command:
spl member grant <your-label> --aud did:sync:agent:helper \
--scopes records:read --max-depth 1 --budget 5The response carries the agent's bearer and the sub-grant id. The server refuses any sub-grant that names more scope than your membership holds or widens a caveat; revoke one delegation without touching your membership with spl member grant-revoke <your-label> <grant-id>. Over HTTP the same pair is POST /v1/members/{label}/grants and DELETE /v1/members/{label}/grants/{grant_id}.
Adopting an existing agent credential
If a service account should have belonged to a member (for example, the credential your personal agent uses), an admin can move it under that member without breaking the running agent:
spl member adopt mora --sa sa_1f8e2c9aThe bearer keeps working through the change. From then on, removing the member ends it like any other member credential.
Choosing, in one paragraph
Give standing infrastructure a service account, and remember you must revoke it yourself. Give a person's agents a sub-grant under that person, and removing them is one command. If unsure, ask who should be responsible when the credential misbehaves, the workspace or a member, and attach it there.
What's next
- Agent integration: dispatching work to agents and building their trust.
- Principals & grants: how grants work.
- Scopes & permissions: scopes, caveats, and delegation rules.
- Add a teammate: the membership flow that sub-grants build on.
Universal traversal: your reach
See everything you reach across all your workspaces in one view, ask questions about the people and threads connected to you, and see how shared threads appear with exactly the access that was granted.
TypeScript SDK
Use Syncropel from JavaScript or TypeScript: add records, query threads, and keep your app running through network errors. Works in Node, Deno, Bun, edge runtimes and browsers.