Skip to main content
An investigation is a case that Squasher works on: a question, a status, a suspected cause, a confidence, and a timeline. While Squasher investigates, it can propose an action, such as a fix pull request. A person approves or rejects each action.

Operations

Project members can start, steer, and cancel investigations. Only an owner or admin can approve, reject, or resolve an action, and only with a signed-in user token: the dashboard, or the CLI after squasher login. The API refuses API keys for these three operations, even a key with the actions:approve scope. The decision records your user id. An irreversible action can be approved only in the dashboard; see Response actions.

Start an investigation

The body has a question, a subject, or both:
The response has status 201, created: true, and the new investigation. An incident has one investigation. When the subject is an incident that already has one, the response has status 200, created: false, and the existing investigation. A repeated idempotency_key also returns 200.
The example leaves out some fields. confidence is a number from 0 to 100. time_to_diagnosis_seconds is the time from the start to the first diagnosis. thread_id is the chat that is linked to the investigation.

List investigations

The response is { "investigations": [...], "total", "limit", "offset" }. With the CLI, use squasher investigations list --project <project-id> --issue <issue-uuid>.

Read an investigation

The response has investigation, entries, and actions. Each timeline entry has a sequence number, a kind, an actor, and a payload. The kinds are hypothesis, evidence, action, note, redirect, and status. Add after_sequence=<n> to get only the entries after entry n. Add include_actions=false to leave out the action proposals (actions is empty) when you poll; read them with actions.list.

Security verdicts

When an investigation is about a security finding, investigation.security_verdict holds the verdict. On other investigations it is null.
  • verdict is benign, suspicious, malicious, or inconclusive. confidence is low, medium, or high.
  • evidence lists each request that the Squasher Agent sent. url runs a Squasher API request again; it is null for a query.
  • When the finding has a Slack alert, the agent also posts the verdict as a reply to that alert.
  • Squasher also writes the verdict to the finding’s security.agent_verdict, so the findings list and the finding page show it. confidence there is a number: low is 0.3, medium is 0.6, and high is 0.9. Each request becomes one query evidence item.
To correct a verdict, an owner or admin sends PUT .../security-verdict from a signed-in session. The body is { "verdict", "reason", "confidence"?, "facts"? }. source becomes user, and agent_verdict keeps the agent’s verdict. The correction also replaces the finding’s security.agent_verdict, with the reason as its summary. The verdict, its timeline entry, the finding, and the facts change together, or nothing changes. Each fact is one statement about one entity, for example { "entity": "aws_access_key:AKIA...", "fact": "the CI deploy key" }. Squasher keeps one fact per entity in the agent’s memory, and the next triage reads it.

Add a note, steer, or cancel

  • notes adds a note to the timeline. The body is { "text" }. The response has status 201 and the new entry in entry.
  • redirect records the direction, and Squasher continues the investigation in that direction. This also works after a diagnosis. The body is { "text" }. The response has status 202.
  • cancel stops an active investigation. The body is optional: { "reason" }.
Text is at most 4,000 characters. A reason is at most 2,000 characters.

List actions

You can filter by status, investigation_id, and incident_id, and set limit (1 to 100, default 50). The statuses are proposed, approved, executing, unknown, succeeded, failed, expired, and rejected. unknown means Squasher sent the call but did not see the result. Squasher does not run the action again; it reads the provider to settle the result.
The example leaves out some fields. See Investigations for the actions and their targets.

Approve or reject an action

Approve runs the action at once. Squasher checks the precondition, calls the provider one time, and checks the postcondition. The response has the action with its final status, precondition, and postcondition. Reject uses the same body at /reject. The reason is optional, but the Squasher Agent reads it. The agent does not propose a rejected action again for the same target in the same investigation. To change the params of a reversible action before it runs, add params to the approve body, for example { "params": { "duration_minutes": 60 } }. Squasher rejects the proposal as edited and runs the changed action at once. An irreversible action cannot be edited: approve it as proposed, or reject it. When the result is unknown, settle it at /resolve. Squasher reads the provider first. When the provider cannot tell, send your finding after you check the provider:
outcome is succeeded or failed. note is optional. When the provider cannot tell and you send no outcome, the response has status 409.

Errors

TypeScript client and CLI

squasher actions approve and squasher actions reject ask you to confirm. Add --yes to skip the prompt.