Documentation
¶
Overview ¶
Package canary plants fake credentials and watches for them leaving.
A canary is a value that looks exactly like a real secret — an AWS key pair, a GitHub token, a database password — and is worth nothing. Put it where an agent could read it (a decoy .env, a fake credentials file) and nothing legitimate will ever send it anywhere. So when a tool call carries it out, in plain text or base64 or hex or URL-encoded, that call is an exfiltration attempt, and agentgate stops it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Kinds = []string{"aws", "github", "openai", "stripe", "password"}
Kinds of canary, each shaped like the real thing.
Functions ¶
Types ¶
type Canary ¶
type Canary struct {
ID string `json:"id"`
Label string `json:"label,omitempty"`
Kind string `json:"kind"`
// Values are the strings that must never leave: an access key id and
// its secret, a token, a password.
Values []string `json:"values"`
// File is the decoy written for it, if any.
File string `json:"file,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
Canary is one planted fake secret.
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector finds canary values in arbitrary text, including the common ways of dressing a secret up to get it past a filter.
func NewDetector ¶ added in v0.5.0
NewDetector builds a detector for values that are not canaries from the store, such as the tainted values of a session.
type Hit ¶
type Hit struct {
Canary Canary
// Encoding is how it was dressed up: plain, base64, hex, url, reversed.
Encoding string
}
Hit is a canary found in a call.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the canaries file: canaries.json next to the audit database, so every agentgate process that shares a config shares its canaries.