Skip to content

Agents inside the product

Agents inside the product work for each Customer: as members of its org, workers on its queue, or the client of record. Each acts under a mandate, through the same gate as a person.

An agent's run, under its mandate

Filled: the run's states, which the Customer sees. Hollow: the mandate chain and the gate.

Capability families

An Agent API sells the agent, a Headless SaaS seats one beside each Customer's people, and a Service API takes one as its client. All three run on one family, offered again to every Customer. The agent belongs to that Customer's org, reads only its records and spends only its budget.

FamilyWhat it gives every product
A runtime per CustomerEach Customer's agents run in its own space, pinned to the Version they started on, and paused, resumed or stopped by Verb
Agents as membersAn agent joins a Customer's org with a Role, like a person: it sees what the Role sees, takes a seat where the plan counts seats, and is suspended or removed the same way
Tools from VerbsAn agent's tools are the product's own Verbs, the Customer's Sources and other products' Verbs, each called through the gate, priced and recorded. It has no other way to act
MemoryWhat an agent learns about one Customer stays in that Customer's space: readable, correctable and erased with the account
SkillsInstructions and examples shipped in the file, changed by a diff like any other line, and checked by evals at deploy
Leases and queuesAn agent claims a task from its Role's queue under a lease, as a person does. A lapsed lease returns the task to the queue with its handoff packet
BrakesCaps declared in the file on runs and spend, per Customer and period. A brake holds the run, braked, and asks the person its mandate names
Acts only a person makesVerbs the file reserves to a person. An agent is refused each one, and a single-use link goes to its person
ProofEvery run's trace: each tool call, its decision, its price and its result, linked to the Action and the receipts it earned
Delegated sendingAn agent sends from the Customer's own Domain, inbox or number under its mandate, in the case's conversation, with what each channel's rules require it to say
The client of recordA buyer's agent files a case, approves the quote, accepts or contests, and pays. The act the law reserves for a person goes to that person by a single-use link

The mandate chain, approvals and the one decision live in Identity, access and policy. An agent inside the product is the principal those rules were written for.

Lifecycles and states

ThingStatesWhat moves it
An agent, as a memberinvited, active, suspended, removedThe Customer's admin; a revoked mandate suspends it; a removal is restorable
An agent's runAn Action: pending while it works (Running) or is braked (AwaitingApproval), then done, failed or cancelledIts work, a brake and the person its mandate names, a cancel by Verb
A task it claimsopen, claimed, done; or released, back to open for the next claimThe agent's claim and completion; a lease that lapses
A leaseheld, renewed, then released or lapsedThe agent's progress; the clock
A brakearmed, tripped, held, then released or resetA cap reached before a call runs; an approval, or the next period
A memory entrywritten, corrected, erasedThe agent; a member's correction; the Customer's erase
A reserved actsent, then made or expiredThe single-use link to the person, and its clock

A braked run holds its place: the move waits as a Pending Action with the reason AwaitingApproval, and an approval runs it once. Skills follow the Version they ship in.

What you declare, what the platform does

You declareThe platform does
An agentic() Verb with its toolsRuns it per Customer, offers only the tools named, sends each through the gate, and meters tokens and minutes
as: the Role the agent holdsAdds it to each Customer's org as a member, applies the Role to every read, and counts a seat if the plan does
memory and skillsKeeps memory in the Customer's space, ships skills with the Version, and refuses a deploy whose skill evals fail
lease on the agent's workLeases each task, renews it while the run progresses, and requeues it on a lapse
brakes in operate: runs and spend per Customer per periodHolds the run at the cap, asks the mandate's person, and resumes once on approval
agents.person: the Verbs only a person makesRefuses each to every agent, sends a single-use link to the person the mandate names, and records who made the act
Nothing elseMandates, traces, delegated sending, the handoff packet, and the check that every agent can pay for what it calls

Example

meetings seats its agent in each Customer's org as an assistant. It leases each lead, stops at a daily brake, and leaves one Verb to a person.

definition.ts
24 lines
import { define, agentic } from 'apis.dev'

/** An agent that books three meetings a week with each Customer's leads, in their own inbox and CRM. */
export default define({
  name: 'meetings', domain: 'meetings.apis.dev',
  sources: { … },                                       // inbox, crm and firms, as before
  roles: { assistant: { see: { Meeting: 'all' } } },
  Meeting: {
    with: 'string', company: 'string', at: 'date',
    book: agentic('Book a meeting with the next lead in {crm}', {
      as: 'assistant',                                  // a member of each Customer's org
      tools: ['inbox', 'crm', 'Meeting.create', 'firms.Company.research'],  // through the gate
      memory: 'customer', skills: ['./skills/booking.md'],
      lease: '30m',                                     // one lead per run at a time
      returns: { meeting: 'string' },
    }),
  },
  agents: { person: ['Meeting.cancel'] },               // only a person cancels a meeting
  on: { 'every Mon, Wed, Fri 09:00': 'Meeting.book' },
  offer: { … },                                         // by tokens, minutes and tool calls, as before
  operate: {
    brakes: { 'Meeting.book': { day: 5, spend: { day: 2 } } },  // per Customer; past it, a person
  },
})

The other way round, an agent is the client of record. Acme's agent orders a Filing for $25 and approves it, but signing the report is reserved to a person. The agent's call is refused, and the link goes to the person, never to the agent.

Response
HTTP/1.1 403 Forbidden
Content-Type: application/problem+json
X-Cost: price=0, currency="USD"
X-Request-Id: req_8d4f2a6e1b0c97e35a14

{
  "type": "https://filings.apis.dev/docs/errors#person_required",
  "title": "Forbidden",
  "status": 403,
  "detail": "Filing.sign is reserved to a person; a link went to dana@acme.com.",
  "code": "person_required",
  "sentTo": "dana@acme.com",
  "mandate": ["dana@acme.com", "org_acme", "agent_7"],
  "instance": "req_8d4f2a6e1b0c97e35a14"
}

The agent watches Filing.signed and carries on: the filing is filed, and the agent accepts or contests it under the Outcome contract.

Contracts with the other subsystems

Agents propose, and the Runtime's gate commits. An agent has no write path a person lacks, and none a person has that the agent's mandate does not name.

SubsystemWhat agents take from itWhat agents give it
Definition and compileThe agent, its tools, Role, brakes and lease, checked at deploy: a tool that is not a Verb or Source, or an agent that cannot pay for its tools, is refusedSkills shipped with the Version, changed by a diff
Identity, access and policyThe mandate chain, the Role, approvals, reserved acts and single-use linksEvery call carrying its mandate, so the decision reads the whole chain
Model and recordsThe Customer's records, masked by the Role; memory kept as recordsRecords written only through Verbs
Data and SourcesThe Customer's inbox, CRM and other Sources, read and written back under consentReads that respect each Source's licence terms
RuntimeThe agentic Function kind, the model router, leases, clocks and AwaitingApprovalEach run as an Action, each tool call through the gate
WorkTasks and queues, handoff packets, review of an agent's output, escalation to a personWork done at the cheapest kind that meets the step's grade
CommerceTokens and minutes metered; the buy side's budget when an agent buys from other sellersSpend per agent, task and seller, against each brake
Interfaces and distributionMCP, the agent card, agent-to-agent tasks; the conversation an agent sends inThe affordance contract an agent reads before it moves
Trust and operationsBrakes, evals and runaway-spend detectionTraces of every run, and the evidence behind every brake

What Customers and their agents meet

  • An agent in the member list. A Customer's admin sees the agent beside its people, with its Role, mandate and spend, and suspends it with one Verb.
  • A brake, not a surprise. At a cap the run waits, braked, and the person its mandate names gets the approval. A grant runs the move once.
  • Its work, in the open. Every run's trace shows each tool call, what the gate decided and what it cost, beside the Action's price.
  • Memory the Customer owns. A member reads and corrects what the agent remembers; an erase removes it with the account.
  • A buyer's agent as client. It files the case, approves the quote, accepts or contests, and pays within its budget. The act reserved for a person reaches that person by a single-use link.
  • One queue for agents and people. A task whose lease lapses returns to the queue with its handoff packet. A person picks it up where the agent stopped.

An agent acts only through the Verbs a person has, under a mandate a person gave, so its work is as checkable as theirs.