Agent records
What an AI agent's directory entry holds, how it links to the users who own it, run it and let it act for them, and how to find agents by any of it.
AvailableAPI
Every AI agent in your realm has an entry in the directory: what it’s for, how risky it is, how far it acts on its own, whether it may run now, and the users it answers to. The links are stored once and read from both ends, so from an agent you find its owner, and from a user every agent they own.
Before you begin
Section titled “Before you begin”- Privilege:
RealmViewerto read and search agents;RealmOwner, or a privilege of your own over agents (*REALM/entity/agent/*), to change them and their owners. See Who may do what. - Where: the API, with your session in
$CVYUH_SESSION(see Call the API). Users see and remove the agents that act for them on their own AI agents page. - The agent is registered: see Register an agent.
How it works
Section titled “How it works”An agent is an object of the agent type, read and written at /objects/v1/agent like any other type.
| Attribute | What it holds |
|---|---|
uid | Its ID, unique in the realm. Required |
displayName | Its name. Required |
purpose | What it’s for, at most 512 characters. Required |
riskClass | minimal, limited, high or unacceptable. Required |
autonomyTier | 1 to 4: how far it acts without a human. Required |
status | active, quarantined, killed or retired. Required |
statusChangedAt | When its status last moved, stamped by the realm |
expiresAt | When it stops, if ever |
framework | Names you keep for your own records |
What each status does to the agent’s tokens is on AI agents.
Links to people and other agents
Section titled “Links to people and other agents”Each link is stored once, and the realm keeps both ends:
| On the agent | On the other end | What it says |
|---|---|---|
businessOwner | ownedAgents, on the user | The one user accountable for the agent |
technicalOwner | The users or groups who run it; an agent may have several | |
actsFor | delegates, on the user | The users it may get a token for, each with a window and a ceiling on scopes. See Agents acting for users |
parent | descendants, on the parent agent | The agent or user it was created under. Set once, never changed |
clients | agent, on the client | The clients it gets tokens through |
grants | The entitlements it holds, each for a window. See Entitlements |
Set it up
Section titled “Set it up”Registering an agent, with its owner and its client, is in Register an agent. Once it exists:
Read an agent with its owner:
curl "https://foobar.cvyuh.com/api/v0/am/objects/v1/agent/invoice-agent?expand=businessOwner/*" \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"List every agent a user owns:
curl "https://foobar.cvyuh.com/api/v0/am/objects/v1/user/maya?expand=ownedAgents/*" \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"Find every active high-risk agent:
curl -G https://foobar.cvyuh.com/api/v0/am/objects/v1/agent \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \ --data-urlencode 'filter={"filter":{"type":"and","rules":[ {"field":"riskClass","op":"=","value":"high"}, {"field":"status","op":"=","value":"active"}]}}'Hand an agent to a new owner
Section titled “Hand an agent to a new owner”Do this whenever an owner leaves, and always before you delete them. Hand an agent to a new owner by removing the old owner’s link and making the new one, each with the agent’s
current revision in If-Match:
curl -X DELETE https://foobar.cvyuh.com/api/v0/am/objects/v1/agent/invoice-agent/relationships/businessOwner/maya \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \ -H 'If-Match: "<rev>"'
curl https://foobar.cvyuh.com/api/v0/am/objects/v1/agent/invoice-agent/relationships/businessOwner \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \ -H "Content-Type: application/json" \ -H 'If-Match: "<rev>"' \ -d '{ "targetId": "ben" }'Find agents that need an owner
Section titled “Find agents that need an owner”Owner links aren’t filter fields, so read them from the user’s side. Before a user is deleted, list what they own
with ?expand=ownedAgents/*, as above, and hand each agent over. To find agents already left without an owner, read
agents with ?expand=businessOwner and look for an empty businessOwner.
Limits and defaults
Section titled “Limits and defaults”| What | Default or limit |
|---|---|
businessOwner | One user. Not required: an agent can exist with none |
technicalOwner, actsFor, clients, grants | Several |
parent | Set once, at creation |
purpose | At most 512 characters |
When a change fails
Section titled “When a change fails”| Answer | Code | What it means | What to do |
|---|---|---|---|
400 | POLICY_VIOLATION, SCHEMA_VALIDATION_FAILED | A required attribute is missing, or a value isn’t one of those allowed (such as a riskClass) | Fix each one named |
400 | INVALID_REQUEST | A filter on a link, such as businessOwner | Read links from the user’s side, or expand them |
409 | SINGLETON_EXISTS | You linked a new businessOwner while the old one is still linked | Remove the old owner’s link first |
412 | REVISION_CONFLICT | The agent changed since the revision you sent | Read it again |
Audit record
Section titled “Audit record”Every change to an agent’s record, its status and its links is recorded on its change history
(CREATED, PATCHED, UPDATED, DELETED), and in the agent’s own trail beside what it did: see
Follow what an agent did.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
An agent has no businessOwner | Its owner was deleted, which removes every link to them | Name a new owner, as above |
409 naming a new owner | The old owner’s link is still there | Remove it, then link the new one |
Good to know
Section titled “Good to know”- No secret field exists. Nothing on an agent’s entry is a password or a shared secret; its client proves itself with a key.
- Lineage is fixed. An agent’s
parentis set when it’s created and can’t be rewritten. - A leaver’s agents stay. Setting a user inactive stops agents acting for them, but agents they own go on until you stop them or name a new owner. See Stop an agent.
- Deleting a user leaves their agents without an owner. Deleting removes every link to the user, so each agent
they owned loses its
businessOwner, and nothing requires one. Hand agents over first.
Related
Section titled “Related”- AI agents: tokens, status and the chain check.
- Register an agent: an agent, its owner and its client.
- The identity model: links, expansion and revisions.