Trace · Concept
Patterns
A pattern is a saved, named filter over a run's canary readings and activation-profile neurons that finds the runs in your history showing a signal you care about.
When to use it
Use a pattern to filter your prompt history to the runs that tripped a canary family, lit up neurons labeled like "credential", or crossed an activation threshold in late layers. In CI, test each run of a suite against a pattern and fail the build on an unexpected match.
How it works
- Pick one from the library or save your own with POST
/. The library has one curated pattern per canary family,v1/ trace/ patterns pat_curated_<family>. - A pattern is evaluated when you read, never when a run is recorded, so a new pattern covers your whole history at once. Pass
patternto the prompt history, a prompt's runs, a profile, a comparison or an attribution trace. - Each result says whether it matched, which visible neurons made it match, and one line per rule saying why.
- Runreadings + profile
- Patternrules, any or all
- Resultmatched, neurons, reasons
The definition
A definition is match (any or all) and one to 16 rules:
Rule kind | Fields | Matches when |
|---|---|---|
family | family, optional min_ | The family's reading tripped, or reached min_ |
neurons | refs, optional min_, min_ | At least min_ of the refs are among the run's visible active neurons |
label | query, optional min_, min_ | Visible active neurons have a registry label containing query |
activation | min, optional layers, pole, min_ | Visible neurons reach min, within the layer range and pole |
{
"name": "Wire instructions in late layers",
"definition": {
"match": "all",
"rules": [
{ "kind": "family", "family": "prompt_injection" },
{ "kind": "activation", "min": 1.5, "layers": [12, 23] }
]
}
}
Neuron rules read the run's activation profile; a run without one can still match a family rule. A masked neuron never matches any rule and never appears in the result, so a pattern can't be used to learn which neurons a curated family guards on.
A match means the run activated neurons associated with the pattern. A family rule's reason quotes the family's measured precision and recall.