Documentation
¶
Overview ¶
Package audit records every tool call as one JSON line.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Time time.Time `json:"time"`
User string `json:"user"`
Transport string `json:"transport"`
Tool string `json:"tool"`
Args map[string]any `json:"args,omitempty"`
Outcome string `json:"outcome"` // "ok", "error", "denied", "pending"
Error string `json:"error,omitempty"`
// Write tools only: the plan shown to the human and how it was approved.
Plan string `json:"plan,omitempty"`
Approval string `json:"approval,omitempty"`
DurationMS int64 `json:"duration_ms"`
OutputSize int `json:"output_bytes"`
}
Event is one tool call. Args must already be redacted by the caller.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger writes events. It is safe for concurrent use.
func Open ¶
Open returns a Logger appending to path (created 0600 if missing). An empty path logs to stderr.