Skip to main content

beam_security

beam_security checks content and actions against a rule base and returns a decision.

beam_security = { path = "../riverbeam/crates/beam_security" }

It depends on river_reed with the grl-rule-engine feature.

ItemRole
SecurityManagementTrait: check(&SecurityRequest) -> SecurityDecision, enforce()
SecurityManagernew(policy), with_enforce(bool), is_ready()
DisabledSecurityManagerAllows everything; the pipeline default
SecurityRequestnew(stage), with_payload(map), with_context(SecurityContext)
SecurityContextagent_id, tenant_id, user_id, interaction_id
SecurityDecisionaction, severity, score, matched_rules, narration, user_message, violation_type; denies(), requires_hitl()
SecurityStageBeforeInput, BeforeContextInjection, BeforeLlm, AfterLlm, BeforeTool, AfterTool, BeforeMemoryWrite, BeforeOutput, BeforeHitlResume, Runtime
SecurityActionAllow, Deny, Warn, Sanitize, RequireApproval, Quarantine, Mask, Terminate
SecurityPolicy, ToolPolicy, HitlConfigTool lists, approval settings, runtime limits
PatternLoaderThe regex scorers
SecurityEngine, verdict_from_narrations, RuleNarrationLower-level engine access

BeforeLlm, AfterTool and BeforeHitlResume are always allowed (PASSTHROUGH_STAGES).

There are no feature flags.

The shipped rules and their current limitations are in Security.