Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By cisco-ai-defensev0.3.0Apache-2.0In 1 marketplace
Write rules that detect threats and behavior patterns in agent conversations, then scan single or batched conversations. Needs Python 3.11 to 3.13 and uv; it says its DSL is alpha and may change before v1.0.0.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Project Quarry is a Python framework for detecting threats and behavior patterns in agent conversations. Write rules over messages, tool calls, tool results, and event order. You can also call a configured model adapter from a rule when local checks are not enough.
Quarry parses and validates rules when you load them, then compiles each rule to a symbolic finite-state automaton. A scan runs that compiled program over the conversation. Rules that cannot compile fail during loading.
Quarry is in alpha, and its DSL syntax may change before v1.0.0 in ways that require updates to existing rules.
Quarry supports Python 3.11 through 3.13.
Setup:
git clone https://github.com/cisco-ai-defense/project-quarry.git
cd project-quarry
uv sync --frozen
Run uv sync --frozen --extra inference if your application uses a built-in model provider.
Scan an example conversation from the repository root:
uv run --frozen quarry scan --config examples/config.yaml --target examples/data/benign.json
examples/config.yaml selects fourteen local rules that run without model credentials.
Four semantic rules use deterministic keyword stubs via an explicit config opt-in; these stubs are for examples and tests, not production decisions.
To see a match, scan examples/data/tool_calls.json with the same config. You can also target examples/data/ to scan every conversation file; a successful scan with matches exits 1.
The full example rule collection is exercised by uv run --frozen python scripts/e2e_signature_test.py, which supplies deterministic model and prober implementations in process.
A YAML configuration file loads your own rules:
config_version: 2
rules:
- rules/
For example, save this rule as rules/credential-request.rule:
rule "Credential request"
strings:
$terms = ["api key", "access token"] nocase
condition:
any msg in user_messages where msg.content contains_any $terms
Pass an OpenAI-shaped conversation as JSON with a messages array. The CLI exits 0 for a complete clean scan, 1 for a complete match, and 2 when the scan is invalid or incomplete.
A .rule file contains one named rule. Quarry parses, validates, links, and compiles it when the scanner loads. The generated language reference lists current functions, fields, operators, and runnable examples.
rule "Suspicious request"
metadata:
description = "Match requests to reveal a secret or override policy"
strings:
$blocked = ["reveal a secret", "ignore the policy"] nocase
variables:
has_blocked_text = any msg in user_messages where msg.content contains_any $blocked
condition:
has_blocked_text
Optional blocks appear in this order: metadata, strings, variables, parameters. Every rule needs condition:. A model span rule can also have a collect: block after condition:. Use // for line comments; #name is the occurrence-count operator.
Use = to define values in metadata:, strings:, and variables:. Use == to compare values in condition: expressions, including predicates inside matches { ... }. Other comparisons remain !=, <, <=, >, and >=.
rule "Shell call"
strings:
$needle = "sudo"
condition:
any call in tool_calls where call.name == "Bash"
and $needle in call.arguments.*
The core packs are maintained by the Quarry team. The community packs are maintained by their contributors and reviewed by the project maintainers. Every rule includes a README describing the threats it covers and its limits. See the rule-pack overview.
7-day copy clicks
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub cisco-ai-defense/project-quarry --plugin quarryPlugins from other owners that cover similar ground