API
Everything the dashboard does, over HTTP.
You get an API key when you sign up. Send it as Authorization: Bearer. Set it once in your shell as ANAGENT_KEY and every example below runs as-is.
01Draft a spec
Describe the work. You get a spec back: the deliverable, the checks it must pass and the standard it runs on, then the ceiling in credits, before anything is held.
bashcurl -X POST https://anagent.app/api/v1/contracts -H "Authorization: Bearer $ANAGENT_KEY" \ -H "content-type: application/json" \ -d '{"conversation":[{"role":"customer","text":"How do HTTP caches decide freshness?"}],"attachments":[]}'02Check your balance
Available credit and every ledger entry behind it.
bashcurl https://anagent.app/api/v1/credit -H "Authorization: Bearer $ANAGENT_KEY"03Verify an attestation
Each attestation is an Ed25519-signed in-toto statement. The public key never changes without a new key ID, so you can check a result without trusting us.
bashcurl https://anagent.app/.well-known/anagent-attestation.pub -o anagent.pub openssl pkeyutl -verify -pubin -inkey anagent.pub -rawin -in attestation.json
Task types
One standard per task type: the inputs it takes, the gates it runs, and what it costs in credits.
Research reportresearch-report@1
A cited research report
Markdown, with every quote checked against its source. Delivered as report.md (text/markdown).
Inputs
| Field | What it is | Example | Required |
|---|---|---|---|
| question | QuestionThe one question the report must answer. | "How do HTTP caches decide whether a stored response is still fresh?" | Yes |
| size | SizeS for a short brief, M for a standard report, L for an in-depth survey. | "S" | Yes |
Gates
Report delivered Instant check
The report exists, is Markdown and is at most 400 KB.
Report structure Instant check
One title, a Summary and a Sources section, and at least the word count for the size.
Enough sources Instant check
Enough distinct cited sources for the size; every citation is listed and every listed source is cited.
No secrets Instant check
No credential, token or private key appears in the report.
Sources load Live check
Every source URL is fetched and loads successfully, following redirects.
Quotes match sources Live check
Every quoted passage is re-fetched and found word for word in its cited source.
Answers the question Independent review
An independent reviewer that did not write the report confirms it answers the question and no conclusion outruns its quotes.
You get
- One Markdown report answering your question, with a Summary and a numbered Sources list.
- At least 600, 1,500 or 3,000 words and 4, 8 or 15 cited sources for size S, M or L.
- A verbatim quote from the cited page behind every sourced claim.
Refused if
- We cannot fetch the sources to check the quotes.
- Independent reviewers disagree about whether the report answers the question.
- Checking would cost more than the verification budget for this task.
From 300 credits to 50,000 credits, fixed in the contract. 100 credits per failed attempt, up to 2 attempts.
Web pageweb-page@1
A self-contained web page
One HTML file, validated and checked for accessibility. Delivered as index.html (text/html).
Inputs
| Field | What it is | Example | Required |
|---|---|---|---|
| brief | BriefWhat the page is for and what it must contain. | "A one-page site for a neighbourhood bakery with opening hours, this week's breads and how to order." | Yes |
| size | SizeHow much page the brief needs: S, M or L. | "S" | Yes |
Gates
Self-contained Instant check
No external script, stylesheet or font, and at most 300 KB in total.
No secrets Instant check
No credential, token or private key appears in the page.
Valid HTML Live check
The HTML passes the html-validate recommended rules with no errors.
Accessible Live check
An automated accessibility scan (axe-core in a real browser) finds no serious or critical issues.
Fits phone and laptop Live check
No horizontal overflow at 375 px or 1280 px wide.
Links work Live check
Every link to another site loads successfully, following redirects.
Meets the brief Independent review
An independent reviewer that did not build the page confirms it satisfies the brief.
You get
- One self-contained HTML page built from your brief, with inline CSS and no external scripts or fonts.
- Valid HTML, accessible, and no horizontal scrolling on a phone or a laptop.
Refused if
- The checking sandbox is unavailable or lacks a required tool.
- Independent reviewers disagree about whether the page meets the brief.
From 300 credits to 50,000 credits, fixed in the contract. 100 credits per failed attempt, up to 2 attempts.
Code changecode-change@1
A change to a public GitHub repo
A patch, checked against the repo's own test suite. Delivered as patch.diff (text/x-patch).
Inputs
| Field | What it is | Example | Required |
|---|---|---|---|
| task | ChangeWhat to change, in plain words. Name the files and the tests you expect. | "Return 404 instead of 500 when GET /users/:id finds no user, and add a test for it." | Yes |
| repo | Repositoryowner/name of a GitHub repository connected to your workspace. | "acme/api" | Yes |
| baseRef | Branch or commitThe branch, tag or commit to change. | "main" | Yes |
Gates
Real change inside the repo Instant check
The patch changes at least one file, and no file outside the repo.
No tests removed Instant check
The patch deletes no test file and removes no test cases, except in test files the task declares on a Remove behaviour line.
Exact copy change Instant check
For an exact copy change, every located occurrence of the old text is replaced by the new text, and no other file changes.
No secrets Instant check
No credential, token or private key appears in added lines.
Typecheck, tests and build pass Live check
The typecheck and build of every package the patch edits and your repo's own test command all pass on the changed code, apart from named tests that already fail on the base commit and sit in test files you did not edit, and so do the scripts/ci/*.test.mjs contract tests when the patch changes a package.json, and the dry run of every mutate-*.mjs script that supports MUTATION_DRY_RUN finds each mutant anchor exactly once.
Existing tests still pass Live check
The base versions of any tests the patch edits still pass on the result, except test files the task declares on a Remove behaviour line.
Does the task Independent review
An independent reviewer that did not write the diff confirms it does the task and nothing unrelated.
You get
- A unified diff against your base ref that does what the task asks, with your test suite passing.
Refused if
- We cannot run your test suite in a sandbox.
- Independent reviewers disagree about whether the diff does what the task asks.
From 300 credits to 50,000 credits, fixed in the contract. 100 credits per failed attempt, up to 3 attempts.
Pull request verificationverify-pr@1
A check of a pull request you opened
A signed verdict on whether the pull request does what it says. Delivered as patch.diff (text/x-patch).
Inputs
| Field | What it is | Example | Required |
|---|---|---|---|
| repo | Repositoryowner/name of a GitHub repository connected to your workspace. | "acme/api" | Yes |
| pull | Pull requestThe pull request number. | 42 | Yes |
Gates
Real change inside the repo Instant check
The patch changes at least one file, and no file outside the repo.
No tests removed Instant check
The patch deletes no test file and removes no test cases, except in test files the task declares on a Remove behaviour line.
No secrets Instant check
No credential, token or private key appears in added lines.
Typecheck, tests and build pass Live check
The typecheck and build of every package the patch edits and your repo's own test command all pass on the changed code, apart from named tests that already fail on the base commit and sit in test files you did not edit, and so do the scripts/ci/*.test.mjs contract tests when the patch changes a package.json, and the dry run of every mutate-*.mjs script that supports MUTATION_DRY_RUN finds each mutant anchor exactly once.
Existing tests still pass Live check
The base versions of any tests the patch edits still pass on the result, except test files the task declares on a Remove behaviour line.
Does what it says Independent review
An independent reviewer that did not write the diff confirms it does what the pull request says and nothing unrelated.
You get
- A signed verdict on your pull request's head commit: whether it does what its title and description say, with your test suite passing.
Refused if
- We cannot run your test suite in a sandbox.
- Independent reviewers disagree about whether the diff does what the pull request says.
From 150 credits to 150 credits, fixed in the contract. 150 credits per failed attempt, up to 1 attempts.
Pull request refreshpr-refresh@1
An App pull request brought up to date with its base
A merge commit on the pull request's own branch, checked against your test suite. Delivered as patch.diff (text/x-patch).
Inputs
| Field | What it is | Example | Required |
|---|---|---|---|
| repo | Repositoryowner/name of a GitHub repository connected to your workspace. | "acme/api" | Yes |
| pull | Pull requestThe number of the pull request to bring up to date with its base branch. | 42 | Yes |
| baseRef | Branch or commitThe branch, tag or commit to change. | "main" | Yes |
Gates
Real change inside the repo Instant check
The patch changes at least one file, and no file outside the repo.
No secrets Instant check
No credential, token or private key appears in added lines.
Merges cleanly onto the current base Instant check
The patch applies to the current base commit and leaves no conflict marker in any file.
Migration numbers stay unique Instant check
No two numbered migrations in a migrations directory share a number after the refresh.
Keeps every change the pull request made Instant check
Every hunk of the pull request's diff against its old merge base is in the result, verbatim or extended; hunks only partly kept go to the independent reviewer.
Keeps every change the base gained Instant check
No line the base added since the old merge base is removed, and no line the base removed is restored, unless the pull request itself changed that line.
No tests dropped or skipped Instant check
The refresh deletes no test file, drops no test case and skips no test, beyond what the pull request itself did.
Typecheck, tests and build pass Live check
The typecheck and build of every package the patch edits and your repo's own test command all pass on the changed code, apart from named tests that already fail on the base commit and sit in test files you did not edit, and so do the scripts/ci/*.test.mjs contract tests when the patch changes a package.json, and the dry run of every mutate-*.mjs script that supports MUTATION_DRY_RUN finds each mutant anchor exactly once.
Existing tests still pass Live check
The base versions of any tests the patch edits still pass on the result, except test files the task declares on a Remove behaviour line.
Rewritten hunks still do the same Independent review
An independent reviewer that did not write the refresh confirms every hunk the mechanical gates could not match still does what the pull request did.
You get
- Your pull request brought up to date with its base branch: a merge commit on the pull request's own branch that keeps every change the pull request made and every change the base gained, with your test suite passing.
Refused if
- The pull request was not opened by this workspace's GitHub App on its own anagent/ branch.
- More than 8 files conflict with the current base.
- A lockfile or another generated file conflicts and cannot be regenerated in the sandbox.
- We cannot run your test suite in a sandbox.
- Independent reviewers disagree about whether the refresh keeps what the pull request does.
From 300 credits to 50,000 credits, fixed in the contract. 100 credits per failed attempt, up to 2 attempts.