Repository navigation
feat(canary): local honeytoken decoys (rebased #491, refs #293) - #496
Merged
Merged
Conversation
Adds docs/canary.md: why a planted value beats a guessed one, how to plant and remove, the five guarantees (local only, rule id not value, never overwrites, reversible, off by default), and the limits worth knowing (only while the recorder runs, not a filesystem tripwire, the values are recognisably fake on purpose). Links it from the README CLI Reference entry.
An opt-in `agentmetry canary` command plants decoy credentials whose use is a finding at the tool boundary, with nothing leaving the machine. - `core/canary.py`: plant / list / remove / forget. State and the generated DLP rules live under `~/.agentmetry/canary/`, so the packaged manifest stays unchanged and an opt-in feature never ships in the default ruleset. - `core/audit/dlp/loader.py`: merge `~/.agentmetry/canary/*.yaml` after the built-in manifest, and only when the directory exists. The hook reads this on every tool call (#171), so that path stays cheap. - `cli`: `agentmetry canary {plant,list,remove,forget}` with `--kind aws|env`, `--scope home|project`, `--project` and `--name`. - README: CLI Reference entry and the collected-test count. How the issue's constraints are held: - Local only: detection is a DLP regex over what the agent already submitted, so there is no callback and no network. - The trail records the rule id, never the value: the rule is anchored on the planted value and the scanner redacts matches like any other token. - Never overwrites a real credential: planting refuses when the profile or key already exists. - Reversible: `remove` deletes exactly what was appended and refuses when the file changed underneath it; `forget` drops bookkeeping for that case. - Off by default: nothing exists until the command runs. No frozen detection file is touched (rules.py, traits.py, engine.py, mitre.py, policies/detection/manifest.yaml). 9 new tests in tests/test_canary.py; full suite 2984 passed, 7 skipped. Closes #293
Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <[email protected]>
5 tasks
Merged
blitzcrieg1
added a commit
that referenced
this pull request
Nov 26, 2026
#497) Generated by Mistral Vibe. Co-authored-by: Mistral Vibe <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased version of #491 by @im02-crypto onto master after #495. Fixed the two Ruff errors that failed CI (S506 noqa on the safe YAML loader, matching loader.py; removed unused import), README recounted to 3013 locally (canary 9 passed, readme-claims 16 passed, ruff clean). Closes #491. Refs #293.