Need more detail? Connect your coding agent to the full docs.

Skip to Content
AMIRILDocs
/

Anomalies

The Anomalies routes of Amiril's HTTP API that an OAuth access token can call, with their parameters, request bodies and responses.

Unusual for this agent

GET
/api/agents/{agentId}/signals

The agent's strongest current evidence across its names โ€” the stored-signal strip on the agent page.

Any access token can call this, read-only or full.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Path Parameters

agentId*string

Response Body

Top signals

application/json
  1. response
signals*array<>
Example Request
curl -X GET 'https://api.amiril.ai/api/agents/string/signals'
Example Response
{  "signals": [    {      "road": "string",      "signal": "string",      "tool": "string",      "path": "string",      "source": "string",      "eventId": "string",      "eventType": "string",      "value": null,      "rarity": 0,      "channel": "string",      "findingClass": "whole_run",      "record": true,      "novel": true,      "sentence": "string",      "inHeadline": true,      "headlineRank": 0,      "group": "string",      "groupLead": true,      "suppressed": true,      "verdict": {        "verdict": "signal",        "reason": "string",        "source": "inferred",        "judgedSentence": "string",        "divergent": true,        "judgedAt": "string"      },      "runId": "string"    }  ]}

One anomaly's full story

GET
/api/anomalies/{unitKind}/{unitId}

Who was involved, where the rarity sits against the lens population, the summary if one ran, every rarity factor with its baseline presentation, and the member runs. Works for the built-in run lens and every data lens.

Any access token can call this, read-only or full.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Path Parameters

unitKind*string
unitId*string

Query Parameters

days?integer
Range1 <= value <= 365
hours?integer
Range1 <= value <= 8760
from?string
to?string

Response Body

Anomaly detail

application/json
  1. response
unitKind*string
unitId*string
identityVersion*number
agentKey*string
complete*boolean
startTs*string
endTs*string
items*number
scores*
wholeRunScore*number
singleEventScore*number
fields*
actors*array<>
standing*|null
baseline*|null
outcome*|null
summary*|null
draft*|null
review*
evidence*array<>
members*array<>
Example Request
curl -X GET 'https://api.amiril.ai/api/anomalies/string/string'
Example Response
{  "unitKind": "string",  "unitId": "string",  "identityVersion": 0,  "agentKey": "string",  "complete": true,  "startTs": "string",  "endTs": "string",  "items": 0,  "scores": {    "top3": 0,    "sum": 0,    "mean": 0  },  "wholeRunScore": 0,  "singleEventScore": 0,  "fields": {    "property1": "string",    "property2": "string"  },  "actors": [    {      "agentKey": "string",      "runs": 0    }  ],  "standing": {    "higher": 0,    "lower": 0,    "total": 0,    "windowDays": 0,    "stoodOut": true,    "bar": 0,    "anomalyClass": "whole_run",    "wholeRunAnomaly": true,    "singleEventAnomaly": true  },  "baseline": {    "edges": [      0    ],    "counts": [      0    ],    "scale": "linear",    "n": 0,    "score": 0,    "observedBin": 0  },  "outcome": {    "succeeded": true,    "by": "condition",    "expected": true  },  "summary": {    "status": "queued",    "headline": "string",    "whatHappened": "string",    "guess": "likely_mistake",    "guessReason": "string",    "ruleFit": "fits",    "ruleFitReason": "string",    "requestedAs": "auto",    "citedEvidence": [      "string"    ],    "model": "string",    "error": "string",    "paused": "allowance_used",    "stale": true,    "updatedAt": "string"  },  "draft": {    "id": "string",    "source": "summariser",    "instruction": "string",    "outcome": "offered",    "reason": "string",    "name": "string",    "text": "string",    "rule": {      "property1": null,      "property2": null    },    "tools": [      "string"    ],    "action": "block",    "sentence": "string",    "agentId": "string",    "agentName": "string",    "firesOnRun": true,    "backtest": {      "pastRuns": 0,      "firedRuns": 0,      "callsScanned": 0,      "callsFired": 0,      "exampleRuns": [        "string"      ],      "few": true,      "capped": true    },    "model": "string",    "createdAt": "string"  },  "review": {    "verdict": {      "verdict": "real",      "reason": "string",      "reviewer": "string",      "judgedAt": "string",      "attributedFinding": {        "road": "string",        "signal": "string",        "tool": "string",        "path": "string",        "source": "string",        "runId": "string"      }    },    "investigator": {      "verdict": "real",      "reason": "string"    },    "legacyMarks": 0  },  "evidence": [    {      "road": "string",      "signal": "string",      "tool": "string",      "path": "string",      "source": "string",      "eventId": "string",      "eventType": "string",      "value": null,      "rarity": 0,      "channel": "string",      "findingClass": "whole_run",      "record": true,      "novel": true,      "sentence": "string",      "inHeadline": true,      "headlineRank": 0,      "group": "string",      "groupLead": true,      "suppressed": true,      "verdict": {        "verdict": "signal",        "reason": "string",        "source": "inferred",        "judgedSentence": "string",        "divergent": true,        "judgedAt": "string"      },      "presentation": {        "kind": "histogram",        "value": 0,        "n": 0,        "edges": [          0        ],        "counts": [          0        ],        "scale": "linear",        "observedBin": 0,        "population": "agent"      },      "calibrated": 0,      "rarestOf": 0,      "runId": "string"    }  ],  "members": [    {      "runId": "string",      "agentKey": "string",      "top3": 0,      "items": 0,      "complete": true,      "startTs": "string",      "via": {        "kind": "string",        "at": "string"      }    }  ]}
DELETE
/api/anomalies/{unitKind}/{unitId}/verdict

Removes the anomaly's verdict and the rarity factor marks it wrote. Marks made by hand and other anomalies' marks stay. Responds with the anomaly's review.

Needs a full access token. A read-only token is refused.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Path Parameters

unitKind*string
unitId*string

Response Body

The anomaly's review

application/json
  1. response
verdict*|null
investigator*|null
legacyMarks*number
Example Request
curl -X DELETE 'https://api.amiril.ai/api/anomalies/string/string/verdict'
Example Response
{  "verdict": {    "verdict": "real",    "reason": "string",    "reviewer": "string",    "judgedAt": "string",    "attributedFinding": {      "road": "string",      "signal": "string",      "tool": "string",      "path": "string",      "source": "string",      "runId": "string"    }  },  "investigator": {    "verdict": "real",    "reason": "string"  },  "legacyMarks": 0}

Review an anomaly

PUT
/api/anomalies/{unitKind}/{unitId}/verdict

Records the reviewer's verdict on the anomaly as a whole, real (a confirmed issue) or not real (normal behavior), one per anomaly, and writes the rarity factor marks it implies: the headline rarity factors of the verdict rarity (the strongest rarity factor of each of its three strongest groups, the ones that count toward the rarity) are marked, or only the rarity factor named in attributedFinding. When the unit's grain has no calibration, or only some rarity factors are graded, raw rarity picks the headline rarity factors instead. Real marks them signal, not real marks them noise. Those marks feed the quiet fields, so a field goes quiet when its rarity factors keep appearing in anomalies marked not real and never in one marked real. Reviewing again replaces the earlier verdict and its marks. Responds with the anomaly's review.

Needs a full access token. A read-only token is refused.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Path Parameters

unitKind*string
unitId*string

Request Body

application/json
  1. body
verdict*AnomalyVerdictWord
Value in"real""not_real"
reason?|null
attributedFinding?

Response Body

The anomaly's review

application/json
  1. response
verdict*|null
investigator*|null
legacyMarks*number
Example Request
curl -X PUT 'https://api.amiril.ai/api/anomalies/string/string/verdict' \  -H 'Content-Type: application/json' \  -d '{  "verdict": "real"}'
Example Response
{  "verdict": {    "verdict": "real",    "reason": "string",    "reviewer": "string",    "judgedAt": "string",    "attributedFinding": {      "road": "string",      "signal": "string",      "tool": "string",      "path": "string",      "source": "string",      "runId": "string"    }  },  "investigator": {    "verdict": "real",    "reason": "string"  },  "legacyMarks": 0}

The anomaly's full trace

GET
/api/trace/{unitKind}/{unitId}

Every stored event of every involved run, one time-ordered log. Steps carry their run and agent so handoffs between agents are visible; flagged steps carry evidence.

Any access token can call this, read-only or full.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Path Parameters

unitKind*string
unitId*string

Query Parameters

maxFieldChars?integer

Cut every string in a step longer than this, ending it with a note of its full length

Range100 <= value <= 100000
stepOffset?integer

Skip this many steps (after flaggedOnly)

Range0 <= value <= 9007199254740991
stepLimit?integer

Return at most this many steps

Range1 <= value <= 10000
flaggedOnly?string

Only the steps that carry evidence

Value in"true""false"

Response Body

Time-ordered steps

application/json
  1. response
unitKind*string
unitId*string
steps*array<>
stepCount*number
matchedSteps?number
roots*
runTotals?
Example Request
curl -X GET 'https://api.amiril.ai/api/trace/string/string'
Example Response
{  "unitKind": "string",  "unitId": "string",  "steps": [    {      "eventId": "string",      "type": "string",      "kind": "generation",      "ts": "string",      "tool": "string",      "payload": {        "property1": null,        "property2": null      },      "payloadTruncated": true,      "flagged": true,      "textCaptureOff": true,      "parentEventId": "string",      "name": "string",      "spanKind": "string",      "endTs": "string",      "durationMs": 0,      "durationIsEstimate": true,      "level": "debug",      "statusMessage": "string",      "model": "string",      "modelParameters": {        "property1": null,        "property2": null      },      "usage": {        "input": 0,        "output": 0,        "total": 0      },      "cost": {        "input": 0,        "output": 0,        "total": 0      },      "ttftMs": 0,      "metadata": {        "property1": "string",        "property2": "string"      },      "runId": "string",      "agentKey": "string"    }  ],  "stepCount": 0,  "matchedSteps": 0,  "roots": {    "property1": {      "name": "string",      "tags": [        "string"      ],      "metadata": {        "property1": "string",        "property2": "string"      },      "sessionId": "string",      "ids": {        "property1": "string",        "property2": "string"      }    },    "property2": {      "name": "string",      "tags": [        "string"      ],      "metadata": {        "property1": "string",        "property2": "string"      },      "sessionId": "string",      "ids": {        "property1": "string",        "property2": "string"      }    }  },  "runTotals": {    "property1": {      "durationMs": 0,      "tokens": {        "input": 0,        "output": 0,        "total": 0      },      "cost": 0,      "errorCount": 0,      "warningCount": 0,      "models": [        "string"      ]    },    "property2": {      "durationMs": 0,      "tokens": {        "input": 0,        "output": 0,        "total": 0      },      "cost": 0,      "errorCount": 0,      "warningCount": 0,      "models": [        "string"      ]    }  }}

Top anomalous activity

GET
/api/anomalies

Most unusual runs in the window, worst first, ranked by a materialized fold column. Judged runs carry their verdict count so the list can sink them.

Any access token can call this, read-only or full.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Query Parameters

days?integer
Range1 <= value <= 365
Default30
rank?string
Default"top3"
Value in"top3""sum""mean"
unit?string
Length1 <= length <= 200
Default"run"
field?string
value?string
agentId?string
records?string
Value in"0""1""true""false"
limit?integer
Range1 <= value <= 200
Default50

Response Body

Ranked runs

application/json
  1. response
windowDays*number
from*string|null
to*string|null
rank*string
Value in"top3""sum""mean"
unit*string
records*boolean
danglingAgent*boolean
danglingUnit*boolean
danglingField*boolean
entries*array<>
Example Request
curl -X GET 'https://api.amiril.ai/api/anomalies'
Example Response200
{  "windowDays": 0,  "from": "string",  "to": "string",  "rank": "top3",  "unit": "string",  "records": true,  "danglingAgent": true,  "danglingUnit": true,  "danglingField": true,  "entries": [    {      "runId": "string",      "unit": "string",      "fields": {        "property1": "string",        "property2": "string"      },      "membersCount": 0,      "agentKey": "string",      "score": 0,      "scores": {        "top3": 0,        "sum": 0,        "mean": 0      },      "items": 0,      "complete": true,      "startTs": "string",      "endTs": "string",      "scoredAt": "string",      "topSentence": "string",      "judgedCount": 0,      "summary": {        "headline": "string",        "stale": true      }    }  ]}
GET
/api/runs/{runId}/presentations

Each rarity factor's baseline presentation (histogram, bars, fields or sequence), keyed as the run's evidence is. eventId narrows to one event's rarity factors; an empty eventId names the run's own. Loaded when rarity factors are shown, so a long run's response stays small.

Any access token can call this, read-only or full.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Path Parameters

runId*string

Response Body

Presentations

application/json
  1. response
presentations*array<>
Example Request
curl -X GET 'https://api.amiril.ai/api/runs/string/presentations'
Example Response
{  "presentations": [    {      "road": "string",      "signal": "string",      "tool": "string",      "path": "string",      "source": "string",      "eventId": "string",      "presentation": {        "kind": "histogram",        "value": 0,        "n": 0,        "edges": [          0        ],        "counts": [          0        ],        "scale": "linear",        "observedBin": 0,        "population": "agent"      }    }  ]}

One run's full story

GET
/api/runs/{runId}

Rarity factors (evidence) strongest first with verdicts and rarity, the run's structural topic with its name and label (a topic labelled bad is a reason to review the run of its own, outside its rarity), the turn layer's reasons naming their turns (a turn in a turn topic labelled bad, a shared concept, an ungrounded value, a novel turn; also outside the rarity), the run's one-sentence summary (what the user wanted, what went wrong and how it ended) with its run topic, and the step-by-step event list (the oldest 10,000 events) with flagged steps badged. Baseline presentations load per event from GET /api/runs/:runId/presentations.

Any access token can call this, read-only or full.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Path Parameters

runId*string

Query Parameters

maxFieldChars?integer

Cut every string in a step longer than this, ending it with a note of its full length

Range100 <= value <= 100000
stepOffset?integer

Skip this many steps (after flaggedOnly)

Range0 <= value <= 9007199254740991
stepLimit?integer

Return at most this many steps

Range1 <= value <= 10000
flaggedOnly?string

Only the steps that carry evidence

Value in"true""false"

Response Body

Run detail

application/json
  1. response
runId*string
agentKey*string
complete*boolean
startTs*string
endTs*string
items*number
scores*
wholeRunScore*number
singleEventScore*number
extractorVersion*string
verdict*
evidence*array<>
cluster*|null
turnReasons*array<|||>
facet*|null
steps*array<>
stepCount*number
matchedSteps?number
root*
totals*
Example Request
curl -X GET 'https://api.amiril.ai/api/runs/string'
Example Response
{  "runId": "string",  "agentKey": "string",  "complete": true,  "startTs": "string",  "endTs": "string",  "items": 0,  "scores": {    "top3": 0,    "sum": 0,    "mean": 0  },  "wholeRunScore": 0,  "singleEventScore": 0,  "extractorVersion": "string",  "verdict": {    "stoodOut": true,    "bar": 0,    "topShare": 0  },  "evidence": [    {      "road": "string",      "signal": "string",      "tool": "string",      "path": "string",      "source": "string",      "eventId": "string",      "eventType": "string",      "value": null,      "rarity": 0,      "channel": "string",      "findingClass": "whole_run",      "record": true,      "novel": true,      "sentence": "string",      "inHeadline": true,      "headlineRank": 0,      "group": "string",      "groupLead": true,      "suppressed": true,      "verdict": {        "verdict": "signal",        "reason": "string",        "source": "inferred",        "judgedSentence": "string",        "divergent": true,        "judgedAt": "string"      },      "calibrated": 0,      "rarestOf": 0    }  ],  "cluster": {    "key": "string",    "letter": "string",    "name": "string",    "label": "bad"  },  "turnReasons": [    {      "kind": "turn_cluster",      "role": "user",      "position": 0,      "cluster": {        "key": "string",        "name": "string"      }    }  ],  "facet": {    "text": "string",    "writer": "string",    "writtenAt": "string",    "cluster": {      "key": "string",      "letter": "string",      "name": "string",      "label": "bad"    },    "distance": 0,    "failure": {      "text": "string",      "cluster": {        "key": "string",        "letter": "string",        "name": "string",        "label": "bad"      }    }  },  "steps": [    {      "eventId": "string",      "type": "string",      "kind": "generation",      "ts": "string",      "tool": "string",      "payload": {        "property1": null,        "property2": null      },      "payloadTruncated": true,      "flagged": true,      "textCaptureOff": true,      "parentEventId": "string",      "name": "string",      "spanKind": "string",      "endTs": "string",      "durationMs": 0,      "durationIsEstimate": true,      "level": "debug",      "statusMessage": "string",      "model": "string",      "modelParameters": {        "property1": null,        "property2": null      },      "usage": {        "input": 0,        "output": 0,        "total": 0      },      "cost": {        "input": 0,        "output": 0,        "total": 0      },      "ttftMs": 0,      "metadata": {        "property1": "string",        "property2": "string"      }    }  ],  "stepCount": 0,  "matchedSteps": 0,  "root": {    "name": "string",    "tags": [      "string"    ],    "metadata": {      "property1": "string",      "property2": "string"    },    "sessionId": "string",    "ids": {      "property1": "string",      "property2": "string"    }  },  "totals": {    "durationMs": 0,    "tokens": {      "input": 0,      "output": 0,      "total": 0    },    "cost": 0,    "errorCount": 0,    "warningCount": 0,    "models": [      "string"    ]  }}

One run's turns

GET
/api/runs/{runId}/turns

The run's conversation turns in order, each side (the user's words, the agent's reply) with its turn topic (nearest centroid within its cut-off; null for no-match or before a fit) with name and label, its novelty against the agent's earlier turns, the shared concepts it hit and, on agent turns, the values it stated that no earlier tool result, user turn or instruction stated. Text only when the workspace keeps message text. reasons are the run's turn-layer reasons as the Anomalies list reads them.

Any access token can call this, read-only or full.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Path Parameters

runId*string

Response Body

The run's turns

application/json
  1. response
runId*string
turns*array<>
reasons*array<|||>
Example Request
curl -X GET 'https://api.amiril.ai/api/runs/string/turns'
Example Response200
{  "runId": "string",  "turns": [    {      "position": 0,      "role": "user",      "eventId": "string",      "text": "string",      "cluster": {        "key": "string",        "letter": "string",        "name": "string",        "label": "bad"      },      "distance": 0,      "novelty": 0,      "noveltyShare": 0,      "concepts": [        {          "id": "string",          "label": "string"        }      ],      "ungrounded": [        "string"      ]    }  ],  "reasons": [    {      "kind": "turn_cluster",      "role": "user",      "position": 0,      "cluster": {        "key": "string",        "name": "string"      }    }  ]}