audit

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package audit records tool calls into the SQLite audit table.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Timestamp  time.Time `json:"timestamp"`
	AgentID    string    `json:"agent_id"`
	ToolName   string    `json:"tool_name"`
	Args       any       `json:"args"`             // already redacted
	Result     any       `json:"result,omitempty"` // already redacted, omitempty for failures
	Error      string    `json:"error,omitempty"`  // non-empty when the tool failed
	DurationMs int64     `json:"duration_ms"`
}

Entry is one row of the audit log.

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

Recorder appends entries to the SQLite audit table.

func NewRecorder

func NewRecorder(db *storage.DB) *Recorder

NewRecorder returns a Recorder bound to the storage layer's audit table.

func (*Recorder) Record

func (r *Recorder) Record(e Entry) error

Record persists one entry. Returns nil immediately on a nil Recorder.

Jump to

Keyboard shortcuts

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