Why detections exist
A finding describes one moment: this file, this commit, this vulnerability. A detection is the rule behind it, and it keeps checking forever. This is the difference between an agent that’s useful once and a platform that compounds. When an agent confirms a vulnerability, the valuable output isn’t only the fix — it’s the rule that catches the same mistake in every repository from then on, cheaply, without an agent having to re-derive it.Detection types
OpenGrep rules
OpenGrep rules support two modes:search— match a pattern. Usepattern,patterns,pattern-either, orpattern-regex.taint— track data flow. Declarepattern-sources,pattern-sinks, and optionallypattern-sanitizers; a match is a source reaching a sink with nothing neutralizing it in between.
INFO, WARNING, or ERROR, and OpenGrep filters by the rule’s own languages
field at run time — so an irrelevant rule exits cheaply rather than wasting a pass.
Policy detections
A policy is a security requirement written in plain language. At run time,detections-runner spawns a
policy-evaluator per policy, bound to that detection so every finding links back to it.
Policies are the right tool when the rule is about intent — business logic, authorization, data handling —
where no pattern captures the requirement and a human reviewer would need to reason about the code.
Fields that matter
The test-to-production lifecycle
New detections start atTEST. Run them, review what they catch, tune the rule, and promote to
PRODUCTION when the signal is trustworthy.
This exists because a noisy detection is worse than no detection — it trains your team to ignore results.
Keeping unproven rules visibly in TEST lets you build the library without eroding trust in it.
Where detections come from
Compiled detections keep provenance back to the upstream document, so a rule can be traced to the
requirement that motivated it.
Authoring a detection
In the web console. Open Detections and create one. The editor syntax-highlights by type — YAML for policies, Markdown with YAML frontmatter for rule types — and labels the language in the header. Customer types the UI doesn’t recognize still render with a generic label rather than breaking. With an agent. Often the better path, because agents can validate as they go:opengrep-rule-creatorwrites and checks an OpenGrep rule.policy-detection-creatorturns a requirement into a stored policy.detection-authorreads a scan’s findings and authors a detection for each — the automated version of the same loop.
Running detections
Adddetections-runner as a workflow step. It lists every stored
detection, triages which apply, and dispatches by type — OpenGrep rules directly, policies via one child
evaluator each. Findings link back to the detection that produced them, so you can see which rules are
earning their place.
Its bias is deliberate: it dispatches when in doubt, because a detection that never ran is worse than a
wasted pass.
The compounding loop
- An agent confirms a vulnerability in chat or a workflow run.
detection-author— or you — turns it into a detection, atTEST.- You review what it catches and promote it to
PRODUCTION. - A
detections-runnerworkflow applies it on every pull request from then on.
Next steps
Run them in a workflow
Add
detections-runner to a chain.Findings
What a detection produces when it matches.
