URL: /code/files/agents · Id: `page:/code/files/agents`

# The agents/ folder: one file and what it compiles to

> What one agents/ file holds, what each key compiles to, and the checks that read it.

One `agents/` file is one seat’s contract: who fills it, its number, its standards, limits and approvals. SalesBuilder compiles it, and `show` traces every key.

```mdx title="agents/sales/prospector.mdx"
---
worker: agent
aliases: [SDR]
results: [{ metric: opened-deals-and-trials, baseline: 2, target: 6, deadline: 2026-12-31 }]
standards: { response: 60m }
limits: { messages: 40 }
autonomy: assist
approvals: { to: founder }
---
The SDR seat: research, first drafts and follow-ups, with every send approved until it earns more.
```

```text title="show"
$ npx startup-builder show agents/sales/prospector.mdx
worker     agent                                                                     agents/sales/prospector.mdx:2
aliases    [SDR]                                                                     agents/sales/prospector.mdx:3
results    [{ metric: opened-deals-and-trials, baseline: 2, target: 6, deadline: 2…  agents/sales/prospector.mdx:4
standards  { response: 60m }                                                         agents/sales/prospector.mdx:5
limits     { messages: 40 }                                                          agents/sales/prospector.mdx:6
autonomy   assist                                                                    agents/sales/prospector.mdx:7
approvals  { to: founder }                                                           agents/sales/prospector.mdx:8
owner      SalesBuilder
```

```text title="leaseline.app"
leaseline.app/
├── plays/
│   ├── cold-email.mdx
│   ├── warm-intros.mdx
│   ├── signup-interviews.mdx
│   ├── lead-reactivation.mdx
│   └── events-and-webinars.mdx
├── audiences/
│   ├── small-property-managers.mdx
│   ├── lapsed-leads.mdx
│   └── renewal-season.mdx
├── sequences/
│   └── cold-email-thread-founder.mdx
├── funnels/
│   └── signup.mdx
├── workflows/
│   └── outbound.mdx
├── agents/   ← this folder
│   ├── sales/prospector.mdx
│   └── marketing/content-lead.mdx
├── systems/
│   └── sequences.mdx
├── domains/
│   └── leaseline.app.mdx
├── offers/
│   ├── pro.mdx
│   └── team.mdx
├── content/
│   └── webinars/60-day-notices.mdx
├── metrics/
│   ├── q4.mdx
│   └── positive-reply-rate.mdx
└── startups.lock
```

## The file
| Key | On the page | Compiles to | Checked by |
| --- | --- | --- | --- |
| `worker` | Who fills it | <Op verb="Role.staff" />: an agent or a person; a hire takes the seat with its queue and number | — |
| `aliases` | Title | the title pages show for the seat | — |
| `results` | Your number | the seat’s Key Result, a node or leaf of the ARR tree inside its band | [S9](/code/checks#s9) |
| `standards` | Standards | the times a Stop reads, such as the 60-minute answer | — |
| `limits` | Limits | count- and time-based caps; crossing one pauses the Play (<Op verb="Limit.raise" />) | — |
| `autonomy` | Autonomy | the starting rung: you approve each one, until 48 of its last 50 pass | — |
| `approvals` | Approvals | who answers an Approval when a call passes its Limit (<Op verb="Approval.approve" />) | — |

## Checks
| Check | It holds | What dev prints |
| --- | --- | --- |
| [S4](/code/checks#s4) | The budget fits the Mandate, or opens an Approval. | `plays/lead-reactivation.mdx:5  S4  budget: 48 USD a month is over Dana’s Mandate of 0. Sign it with Mandate.authorize, or the first send waits on an Approval.` |
| [S9](/code/checks#s9) | Each Key Result names a node or leaf of the ARR tree, and a seat’s Key Result sits in its band. | `agents/sales/prospector.mdx:4  S9  results: reply-count is not a node or leaf of the ARR tree. Did you mean positive-reply-rate?` |

## Refusals
| Code | Fix, then the call that clears it |
| --- | --- |
| [`batch-cap`](/code/refusals#check-batch-cap) | Split the batch, or approve the larger one. Then <Op verb="Approval.approve" />. |
| [`claim`](/code/refusals#check-claim) | Cut the line, or cite the Offer term that grants it. Then <Op verb="Conversation.answer" />. |
| [`clinician-hold`](/code/refusals#check-clinician-hold) | Ask the Compliance Officer to approve the invitation; it waits until then. Then <Op verb="Approval.approve" />. |
| [`comparison-claim`](/code/refusals#check-comparison-claim) | Approve the changed claim once; it publishes after the approval. Then <Op verb="Approval.approve" />. |
| [`concentration`](/code/refusals#check-concentration) | Approve it as a long deal above the cap, or add creators first. Then <Op verb="Approval.approve" />. |
| [`credit`](/code/refusals#check-credit) | Raise the credit Limit, or block the key drawing from 2 accounts. Then <Op verb="Limit.raise" />. |
| [`deploy-freeze`](/code/refusals#check-deploy-freeze) | Ship it after day 5, or ship an approved fix in steps; reverts always run. Then <Op verb="Approval.approve" />. |
| [`domain`](/code/refusals#check-domain) | Confirm the viewer yourself, or keep the report held. Then <Op verb="Task.next" />. |
| [`draft-match`](/code/refusals#check-draft-match) | Approve the changed Order again; the old Card voids. Then <Op verb="Approval.approve" />. |
| [`editorial`](/code/refusals#check-editorial) | Pass it before the deadline, or the week records checked, nothing to send. Then <Op verb="Approval.approve" />. |
| [`exclusive`](/code/refusals#check-exclusive) | Wait for the first offer to be declined or expire, then offer the next. Then <Op verb="Task.next" />. |
| [`field-scope`](/code/refusals#check-field-scope) | Ask the admin once in writing; the field joins on their yes. Then <Op verb="Conversation.answer" />. |
| [`fraud-hold`](/code/refusals#check-fraud-hold) | Decide pay or void on the Approval. Then <Op verb="Approval.approve" />. |
| [`gift-approval`](/code/refusals#check-gift-approval) | Approve it in your queue; a gift never sends on a timeout. Then <Op verb="Approval.approve" />. |
| [`invitation-rest`](/code/refusals#check-invitation-rest) | Wait 60 days, or 180 days after 2 unanswered invitations. Then <Op verb="Task.next" />. |
| [`keep-first`](/code/refusals#check-keep-first) | Let their CSM reach them first, then ask again once they are healthy. Then <Op verb="Task.next" />. |
| [`late-send`](/code/refusals#check-late-send) | Approve the next window sooner, or promote the cell; the expired send never goes. Then <Op verb="Approval.approve" />. |
| [`license-allowlist`](/code/refusals#check-license-allowlist) | Replace the dependency, or add its license to the allowlist with your OK. Then <Op verb="Approval.approve" />. |
| [`no-cash-or-travel`](/code/refusals#check-no-cash-or-travel) | Send a take-home gift through gift delivery under the class cap, with its Approval. Then <Op verb="Approval.approve" />. |
| [`payout-limit`](/code/refusals#check-payout-limit) | Approve the run, or split it at the Limit. Then <Op verb="Approval.approve" />. |
| [`pending-ceiling`](/code/refusals#check-pending-ceiling) | Withdraw requests pending 14 days or more. Then <Op verb="Task.next" />. |
| [`pilot-cap`](/code/refusals#check-pilot-cap) | Wait in the queue for the dated start, or end a running pilot first. Then <Op verb="Task.next" />. |
| [`portfolio-caps`](/code/refusals#check-portfolio-caps) | Take the next open date the caps allow. Then <Op verb="Task.next" />. |
| [`price`](/code/refusals#check-price) | Get the discount approved, or quote at the floor. Then <Op verb="Approval.approve" />. |
| [`probe-limit`](/code/refusals#check-probe-limit) | Approve the raise, or keep the probe at its line. Then <Op verb="Approval.approve" />. |
| [`reconcile`](/code/refusals#check-reconcile) | Clear the Stripe mismatch, then send again. Then <Op verb="Task.next" />. |
| [`recording-hold`](/code/refusals#check-recording-hold) | Announce it at the start, under the host’s grant. Then <Op verb="Task.next" />. |
| [`rival-name`](/code/refusals#check-rival-name) | Cite a dated fact for the rival, then approve the phrase. Then <Op verb="Approval.approve" />. |
| [`role-unstaffed`](/code/refusals#check-role-unstaffed) | Staff the Role, or leave it: its routes come to you. Then <Op verb="Role.staff" />. |
| [`screening`](/code/refusals#check-screening) | Review the hit yourself; nothing is released until you clear it. Then <Op verb="Task.next" />. |
| [`session-gate`](/code/refusals#check-session-gate) | Send from the tray yourself; no connector gets your login. Then <Op verb="Task.next" />. |
| [`store-billed`](/code/refusals#check-store-billed) | Link the store’s own refund path; no button or guarantee shows. Then <Op verb="Conversation.answer" />. |
| [`terms-hold`](/code/refusals#check-terms-hold) | Clear the partner’s terms; the build stays private until then. Then <Op verb="Task.next" />. |
| [`tier-gate`](/code/refusals#check-tier-gate) | Wait for the 28-day region read, then approve the raise. Then <Op verb="Approval.approve" />. |
| [`verification`](/code/refusals#check-verification) | Review the List; send to the verified addresses only. Then <Op verb="Task.next" />. |
| [`viewer-limit`](/code/refusals#check-viewer-limit) | Approve the new viewer, or keep the list as it is. Then <Op verb="Approval.approve" />. |
| [`window-close`](/code/refusals#check-window-close) | Send the pitch inside its window; a late one drops. Then <Op verb="Task.next" />. |
| [`spend-limit`](/code/refusals#stop-spend-limit) | Raise the Limit, or wait for the month to reset. Then <Op verb="Limit.raise" />. |
| [`unanswered-positive`](/code/refusals#stop-unanswered-positive) | Answer the reply, then approve the resume. Then <Op verb="Approval.approve" />. |

## Calls

```text title="agents/ compiled · Ask"
Seat the agent as our SDR and show me its first task, as a dry run.
```

```ts title="agents/ compiled · SDK"
import { $ } from 'startup-builder'

await $.Role.staff({ role: 'role_1', worker: 'worker_1' }, { mode: 'try' })   // agents/sales/prospector.mdx
return await $.Task.next()   // the seat’s queue
```

```json title="agents/ compiled · Response · sample"
{
  "task": {
    "$id": "https://api.sb/leaseline.app/tasks/task_1",
    "$type": "Task",
    "status": "pending",
    "mode": "try"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/action_1",
    "operation": "Task.next",
    "status": "done"
  }
}
```

| Call | What it does |
| --- | --- |
| <a id="role-staff"></a><Op verb="Role.staff" /> | Staff fills a Role with a Worker, human or agent, who then performs the Role’s Verbs under its Permissions. Emits [`Role.staffed`](/code/events#role-staffed). |
| <a id="mandate-authorize"></a><Op verb="Mandate.authorize" /> | Authorize grants an Agent a standing Mandate to perform a Verb within a Limit, without asking each time. Emits [`Mandate.authorized`](/code/events#mandate-authorized). |
| <a id="mandate-spend"></a><Op verb="Mandate.spend" /> | Spend pays an outside party for a Startup with a single-use card, within a Mandate and its Limit. Emits [`Mandate.spent`](/code/events#mandate-spent). |
| <a id="approval-approve"></a><Op verb="Approval.approve" /> | Approve allows the pending Action an Approval holds, and that Action runs. Emits [`Approval.approved`](/code/events#approval-approved). |
| <a id="limit-raise"></a><Op verb="Limit.raise" /> | Raise lifts a Limit after an Approval allows it, and the Action that waited on it proceeds. Emits [`Limit.raised`](/code/events#limit-raised). |
| <a id="task-next"></a><Op verb="Task.next" /> | Next returns the oldest open Task the calling Worker’s Roles may claim, without claiming it. Emits [`Task.offered`](/code/events#task-offered). |
| <a id="action-redirect"></a><Op verb="Action.redirect" /> | Redirect changes a pending Action’s inputs or target inside its delay window, before it runs. Emits [`Action.redirected`](/code/events#action-redirected). |
| <a id="conversation-answer"></a><Op verb="Conversation.answer" /> | Answer replies in a Conversation through the Channel it arrived on and closes the reply Task it opened. Emits [`Conversation.answered`](/code/events#conversation-answered). |