audit

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package audit records approval and tool execution events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// Type describes the event kind.
	Type string
	// Tool is the tool name.
	Tool string
	// CorrelationID links related events.
	CorrelationID string
	// Decision is the approval decision.
	Decision string
	// Reason provides additional context.
	Reason string
}

Event represents an audit entry for tool execution and approvals.

type Logger

type Logger interface {
	// Record stores an audit event.
	Record(ctx context.Context, event Event)
}

Logger records audit events.

type StdLogger

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

StdLogger writes audit events to slog.

func New

func New(logger *slog.Logger) *StdLogger

New returns a StdLogger.

func (*StdLogger) Record

func (l *StdLogger) Record(_ context.Context, event Event)

Record logs an audit event.

Jump to

Keyboard shortcuts

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