Build and run / Harnesses

Harnesses

Updated 28 Oct 20264 min read

Some work never fits in one run. Keeping an application free of vulnerable dependencies means scanning every night, fixing what can be fixed, waiting for a person to approve the change, checking that the fix really landed, and chasing the finding when nobody answers. A harness runs that whole process for you.

A harness is one template that says which bot handles each step in the life of a piece of work, where the work goes next, and what the limits are. The bots do the thinking. The harness does the moving, waiting, counting and remembering.

When to use a harness

Use a harness when the outcome spans many runs, tools and owners, and different pieces of work need different routes. For a fixed sequence of steps that runs the same way every time, a workflow is simpler. Choosing a workflow or a harness compares the two with examples.

TeamA harness that...
AppSecscans a repository nightly, fixes vulnerable packages in one pull request per change, waits for the merge and re-scans to prove the fix
SOCgroups user-reported phishing by campaign, triages it, contains and purges after approval, and watches sign-ins for 24 hours
GRCcollects evidence for every control that is due, reviews it against the control and sends gaps to the control owner
Identitychecks risky grants for real use, asks the owner, revokes with approval and confirms the access is gone
Cloud posturefixes misconfigurations through infrastructure-as-code pull requests and re-checks the rule

How a harness works

Here is one night of an AppSec harness:

  1. Work comes in. At 02:00 the scanner bot (an input) runs and records 28 findings as tasks in Guardian.
  2. Findings are grouped. The harness waits until the scan finishes, then bundles related findings into one group task, so one scan becomes one fix instead of 28.
  3. The fix stage runs. The fix bot gets the whole group, updates the packages, opens a pull request and reports a result for every finding.
  4. The task waits for the merge. The harness parks the task and listens to your repository. No bot runs, and nothing is spent, while it waits.
  5. The verify stage proves it. After the merge, a different bot re-scans and marks each finding fixed or not fixed. Fixed findings close; the rest go back for the next round.
  6. Stalls escalate. If nobody acts in time or the deadline passes, the task moves to an escalation stage that asks a person.
  7. Regressions reopen. If a closed finding is seen again within 30 days, its task reopens instead of a new one being created.

Every move is written to the task's timeline, and every real action, such as a pull request opened or a message sent, is recorded under What it did on the task.

The parts of a harness

PartWhat it is
ApplicationWhat the harness looks after, such as payments-api. Its tasks and bots belong to it.
InputA bot that brings work in: a scheduled scanner, a webhook, or a list of what is due. It only records tasks; it never fixes anything.
TaskOne piece of work, such as one finding or one alert. The same tasks you see in Guardian.
GroupRelated findings bundled into one task, so they get one fix and one approval.
StageOne step in a task's life, such as triage, fix, approve, verify or escalate. Each stage runs one bot.
TransitionA rule that moves the task on: "if the fix bot reports pr_opened, go to the merge stage".
InterruptA rule that can move a task from any stage: "if the deadline passes, escalate".
ReactionA bot that runs on the side without moving the task, such as notifying an owner.
Limits and policyHow often a stage may repeat, how many bots run at once, a monthly budget, deadlines per severity, and which tools need a person's approval.
MemoryA memory space where the harness's bots keep notes, raw results and history.

The full template format is in Harness templates.

Harness types

The type of a harness sets the limits of what its bots may ever do. An AppSec harness, for example, can never delete user accounts, whatever its bots are allowed elsewhere.

TypeFor
appsecVulnerabilities in code, dependencies, containers and running applications
socAlerts and incidents, such as reported phishing
grcControl evidence and compliance gaps
iamopsAccess reviews and identity hygiene
cloud_postureCloud misconfigurations
finopsCost anomalies
genericAnything else

Who builds a harness

You describe the outcome to Optimus, and Optimus builds the harness with you: it asks its questions in one go, writes a plan for you to approve, creates the bots, writes the template and tests it safely before you switch it on. Start from Build a harness on Guardian > Harnesses: pick a ready template or start from scratch, and Optimus opens with the request filled in. See Build a harness.

To run the same harness on many applications, save it as an org template; it is proposed on every matching application. See Roll a harness out with an org template.

Next steps

Need a hand with this?Our engineers can walk through it with you on your own stack.