Module security
Expand description
Security subsystem for policy enforcement, sandboxing, and secret management.
Re-exports§
pub use audit::AuditEvent;pub use audit::AuditEventType;pub use audit::AuditLogger;pub use detect::create_sandbox;pub use detect::linux_memcg_available;pub use detect::SandboxPosture;pub use detect::sandbox_posture;pub use estop::EstopLevel;pub use estop::EstopManager;pub use estop::EstopState;pub use estop::ResumeSelector;pub use external_content::ContentSafety;pub use external_content::FramingPolicy;pub use external_content::OutboundPolicy;pub use external_content::ScanOutcome;pub use external_content::ScanPolicy;pub use external_content::ScreenVerdict;pub use external_content::cap_untrusted;pub use external_content::frame_untrusted;pub use external_content::new_marker_id;pub use external_content::sanitize_untrusted;pub use external_content::scan_untrusted;pub use external_content::scrub_outbound;pub use ingress::IngressPolicy;pub use ingress::ingress_policy;pub use otp::OtpValidator;pub use traits::NoopSandbox;pub use traits::Sandbox;pub use iam_policy::IamPolicy;pub use iam_policy::PolicyDecision;pub use nevis::NevisAuthProvider;pub use nevis::NevisIdentity;pub use leak_detector::LeakDetector;pub use leak_detector::LeakResult;pub use prompt_guard::GuardAction;pub use prompt_guard::GuardResult;pub use prompt_guard::PromptGuard;
Modules§
- audit
- Audit logging for security events
Each audit entry is chained via a Merkle hash:
entry_hash = SHA-256(prev_hash || canonical_json). This makes the trail tamper-evident — modifying any entry invalidates all subsequent hashes. - auth_
provider - RFC inbound authentication seam: the
AuthProvidertrait + a default-denyProviderRegistry. - detect
- Auto-detection of available security features
- docker
- Docker sandbox (container isolation)
- domain_
matcher - estop
- external_
content - Content-safety helpers for untrusted external SOP payloads.
- firejail
- Firejail sandbox (Linux user-space sandboxing) Firejail is a SUID sandbox program that Linux applications use to sandbox themselves.
- iam_
policy - IAM-aware policy enforcement for Nevis role-to-permission mapping. Evaluates tool and workspace access based on Nevis roles using a deny-by-default policy model. All policy decisions are audit-logged.
- ingress
- Universal ingress policy front door (RFC phase 1).
- leak_
detector - Credential leak detection for outbound content.
- nevis
- Nevis IAM authentication model_provider for ZeroClaw.
- otp
- pairing
- playbook
- Incident response playbook definitions and execution engine.
- policy
- prompt_
guard - Prompt injection defense layer.
- secrets
- traits
- Sandbox trait for pluggable OS-level isolation.
- vulnerability
- Vulnerability scan result parsing and management. Parses vulnerability scan outputs from common scanners (Nessus, Qualys, generic CVSS JSON) and provides priority scoring with business context adjustments.
Structs§
- Domain
Matcher - Pairing
Guard - Secret
Store - Manages encrypted storage of secrets (API keys, tokens, etc.)
- Security
Policy
Enums§
- Autonomy
Level - The agent’s autonomy level, ordered from least to most autonomous.
Functions§
- redact
- Redact sensitive values for safe logging. Shows first 4 characters + “***” suffix. Uses char-boundary-safe indexing to avoid panics on multi-byte UTF-8 strings. This function intentionally breaks the data-flow taint chain for static analysis.
- scrub
- Scrub credential leaks from arbitrary text before it crosses into a log
record or any other sink. Routes through the global
LeakDetectorso every known credential shape is redacted in one place rather than via per-callsite regexes. Clean input is returned unchanged. - scrub_
with_ config - Scrub credential leaks using the configured leak-detection policy.