privacy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package privacy provides utilities for protecting sensitive data.

Package privacy provides privacy tag handling for engram.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(text string) string

Clean performs full privacy cleaning on text. This is the main function to use before storing any user content.

func ContainsSecrets

func ContainsSecrets(text string) bool

ContainsSecrets checks if the given text contains any patterns that look like secrets. Returns true if potential secrets are detected.

func IsEntirelyPrivate

func IsEntirelyPrivate(text string) bool

IsEntirelyPrivate checks if the text is entirely within <private> tags.

func RedactSecrets

func RedactSecrets(text string) string

RedactSecrets replaces detected secrets with a redaction marker. This allows the text to be stored while protecting sensitive data.

func SanitizeObservation

func SanitizeObservation(narrative string, facts []string) bool

SanitizeObservation checks multiple fields of an observation for secrets. Returns true if any secrets were found. This function is used as a validation gate before storing observations.

func StripAllTags

func StripAllTags(text string) string

StripAllTags removes both private and memory context tags.

func StripMemoryTags

func StripMemoryTags(text string) string

StripMemoryTags removes all <engram-context>...</engram-context> content from text.

func StripPrivateTags

func StripPrivateTags(text string) string

StripPrivateTags removes all <private>...</private> content from text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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