secrets

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package secrets provides secret-detection utilities shared across the codebase.

Used by:

  • brain/ingestor: scrub code before sending to the local LLM
  • federation/tracker_brain: filter secrets from cross-project code analysis

Keeping detection logic in one place ensures consistent coverage and prevents pattern drift between consumers (value 2: user data never leaks).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterLines

func FilterLines(content string) string

FilterLines removes lines that look like they contain secrets from content. Also strips entire PEM blocks (BEGIN to END markers inclusive).

func LooksLikeSecret

func LooksLikeSecret(line string) bool

LooksLikeSecret returns true if the line likely contains a secret value. Two-phase approach: cheap substring scan (fast-path), then regex for nuanced detection across all assignment styles (code, YAML, JSON, connection strings).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL