age Encryption Secret Key
Detects age v1 X25519 private encryption keys (AGE-SECRET-KEY-1 followed by 58 uppercase Bech32 data characters, 74 characters total). age keys are widely used with Mozilla SOPS, chezmoi, NixOS (agenix/sops-nix), and Kubernetes GitOps repositories to encrypt committed secrets.
- Type
- regex
- Engine
- boost_regex
- Confidence
- high
- Confidence justification
- High confidence: the uppercase Bech32 human-readable prefix AGE-SECRET-KEY-1 and exact 58-character Bech32 alphabet body are specified by age-encryption.org/v1 and pinned identically by gitleaks, TruffleHog, and GitHub secret scanning.
- Jurisdictions
- global
- Regulations
- Criminal Code Act 1995 (Cth)
- Frameworks
- CIS Controls, ISO 27001, NIST CSF, SOC 2
- Data categories
- credentials, security
- Scope
- narrow
- Risk rating
- 8
- Platform compatibility
- Purview: Compatible, GCP DLP: Unsupported, Macie: Unsupported, Zscaler: Compatible, CrowdStrike DLP: Unsupported, Palo Alto: Unsupported, Netskope: Unsupported
Pattern
(?-i)(?<![A-Za-z0-9_-])(AGE-SECRET-KEY-1[02-9AC-HJ-NP-Z]{58})(?![A-Za-z0-9_-])
Corroborative evidence keywords
age1, SOPS_AGE_KEY, SOPS_AGE_KEY_FILE, age-encryption.org, api key, api_key, apikey, access key, access token, auth token, authorization, bearer, conn str, connection string, connectionstring, cookie, credential, database, host, [object Object] (+37 more)
Proximity: 300 characters
Should not match
AGE-SECRET-KEY-1SHORTPAYLOAD— Bech32 payload shorter than 58 charactersAGE-SECRET-KEY-1BBBBBBBBBBBB— Contains excluded Bech32 character B and short lengthage10000000000000000000000000000000000000000000000000000000000— Public recipient key (age1...) — safe to publish, must not alert as secret keytemplate example placeholder record identifier— Template/sample context should be excluded even when anchor words are present
Known false positives
- Throwaway test keys committed in public SOPS or agenix integration fixtures. Mitigation: Excluded when framed as test/example fixtures by template-exclusion; verify whether the matching age1 recipient encrypts live repository secrets.
References
- C2SP age v1 file encryption specification (AGE-SECRET-KEY-1 Bech32 X25519 identity format)
- gitleaks age-secret-key rule (AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58})