Core safety framework architecture for autonomous agent guardrails: **Core Components:** - SafetyGuardian: Main orchestrator for all safety checks - AuditLogger: Comprehensive audit logging with hash chain tamper detection - SafetyConfig: Pydantic-based configuration - Models: Action requests, validation results, policies, checkpoints **Exception Hierarchy:** - SafetyError base with context preservation - Permission, Budget, RateLimit, Loop errors - Approval workflow errors (Required, Denied, Timeout) - Rollback, Sandbox, Emergency exceptions **Safety Policy System:** - Autonomy level based policies (FULL_CONTROL, MILESTONE, AUTONOMOUS) - Cost limits, rate limits, permission patterns - HITL approval requirements per action type - Configurable loop detection thresholds **Directory Structure:** - validation/, costs/, limits/, loops/ - Control subsystems - permissions/, rollback/, hitl/ - Access and recovery - content/, sandbox/, emergency/ - Protection systems - audit/, policies/ - Logging and configuration Phase A establishes the architecture. Subsystems to be implemented in Phase B-C. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
20 lines
309 B
Python
20 lines
309 B
Python
"""
|
|
Audit System
|
|
|
|
Comprehensive audit logging for all safety-related events.
|
|
"""
|
|
|
|
from .logger import (
|
|
AuditLogger,
|
|
get_audit_logger,
|
|
reset_audit_logger,
|
|
shutdown_audit_logger,
|
|
)
|
|
|
|
__all__ = [
|
|
"AuditLogger",
|
|
"get_audit_logger",
|
|
"reset_audit_logger",
|
|
"shutdown_audit_logger",
|
|
]
|