secrets

package
v0.37.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package secrets stages short-lived credentials for an agent to install.

Values never pass through chat input, are not persisted in the user's message, and Moa does not send them to the model. It is not a vault or a boundary against the agent: its shell runs as the same Unix user and can read these files. A value the agent reads or prints enters model context and the transcript like any other tool output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Forget

func Forget(dir string) error

Forget best-effort removes one batch. It refuses paths outside this package's base directory and never removes the base itself.

func Note

func Note(dir string, names []string) string

Note returns the one message the agent receives for a complete secret batch.

func Reap

func Reap()

Reap best-effort removes batches older than six hours. It only touches this package's random batch directory names, does not follow symlinks, and never removes the base directory itself.

func StartReaper

func StartReaper(ctx context.Context) <-chan struct{}

StartReaper removes expired batches periodically until ctx is cancelled. The returned channel closes after the ticker and its goroutine have stopped.

func Stash

func Stash(entries []Entry) (dir string, err error)

Stash writes one 0600 file per entry into a new random 0700 directory. Values are intentionally never included in errors.

Types

type Entry

type Entry struct {
	Name  string
	Value string
}

Entry is one named secret to stage. Name is an alias, not a destination filename: the agent decides where the relevant client expects the value.

Jump to

Keyboard shortcuts

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