Skip to content
Directory & LifecycleMarkdown

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.

  • Privilege: RealmViewer to 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.

An agent is an object of the agent type, read and written at /objects/v1/agent like any other type.

AttributeWhat it holds
uidIts ID, unique in the realm. Required
displayNameIts name. Required
purposeWhat it’s for, at most 512 characters. Required
riskClassminimal, limited, high or unacceptable. Required
autonomyTier1 to 4: how far it acts without a human. Required
statusactive, quarantined, killed or retired. Required
statusChangedAtWhen its status last moved, stamped by the realm
expiresAtWhen it stops, if ever
frameworkNames you keep for your own records

What each status does to the agent’s tokens is on AI agents.

Each link is stored once, and the realm keeps both ends:

On the agentOn the other endWhat it says
businessOwnerownedAgents, on the userThe one user accountable for the agent
technicalOwnerThe users or groups who run it; an agent may have several
actsFordelegates, on the userThe users it may get a token for, each with a window and a ceiling on scopes. See Agents acting for users
parentdescendants, on the parent agentThe agent or user it was created under. Set once, never changed
clientsagent, on the clientThe clients it gets tokens through
grantsThe entitlements it holds, each for a window. See Entitlements

Registering an agent, with its owner and its client, is in Register an agent. Once it exists:

Read an agent with its owner:

Terminal window
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:

Terminal window
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:

Terminal window
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"}]}}'

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:

Terminal window
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" }'

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.

WhatDefault or limit
businessOwnerOne user. Not required: an agent can exist with none
technicalOwner, actsFor, clients, grantsSeveral
parentSet once, at creation
purposeAt most 512 characters
AnswerCodeWhat it meansWhat to do
400POLICY_VIOLATION, SCHEMA_VALIDATION_FAILEDA required attribute is missing, or a value isn’t one of those allowed (such as a riskClass)Fix each one named
400INVALID_REQUESTA filter on a link, such as businessOwnerRead links from the user’s side, or expand them
409SINGLETON_EXISTSYou linked a new businessOwner while the old one is still linkedRemove the old owner’s link first
412REVISION_CONFLICTThe agent changed since the revision you sentRead it again

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.

SymptomCauseFix
An agent has no businessOwnerIts owner was deleted, which removes every link to themName a new owner, as above
409 naming a new ownerThe old owner’s link is still thereRemove it, then link the new one
  • 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 parent is 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.