Skip to content

DOCS

Canaries

A canary is a fake credential file. It cannot authenticate anywhere. The file itself does not contain any banner identifying it as fake; it looks realistic. plant prints a warning so you can tell it apart. If an agent reads it, Guard denies the read.

balerx canary plant aws
balerx canary plant env --location /tmp/canary.env
balerx canary plant env --location /tmp/test-canary.env --force
balerx canary plant ssh
balerx canary plant generic
balerx canary list
balerx canary check /tmp/canary.env
balerx canary remove CANARY_ID

Types are aws, env, ssh, and generic. --location or -l chooses the file. Without it, the file is created under ~/.balerx/canaries using credentials, .env, id_rsa, or secret.txt.

By default, plant refuses to overwrite an existing file. Pass --force or -f to replace an existing file. Symbolic links, dangling symlinks, and symlinked parent directories are always refused, even with --force, to prevent writing through a link to an unintended location. Planting twice with --force onto the same path replaces the previous canary and creates exactly one registry entry for that path.

remove takes the id printed by list. check takes a path. It exits 0 when the path is not a planted canary, 2 when it is, and 1 when the file is missing. list shows planted canaries sorted by creation time.

Do not replace a real credential with a canary. Plant the canary beside the paths you want to watch. If you need to replace an existing file for testing, use --force carefully with a throwaway path.