-
Notifications
You must be signed in to change notification settings - Fork 0
feat: cumulative risk-unit action budgets with shadow mode #806
Copy link
Copy link
Open
Labels
prio:mediumShould do, but not blockingShould do, but not blockingscope:medium1-3 days of work1-3 days of workspec:budgetDESIGN_SPEC Section 10 - Cost & Budget ManagementDESIGN_SPEC Section 10 - Cost & Budget Managementspec:securityDESIGN_SPEC Section 12 - Security & Approval SystemDESIGN_SPEC Section 12 - Security & Approval Systemtype:featureNew feature implementationNew feature implementationv0.6Minor version v0.6Minor version v0.6v0.6.6Patch release v0.6.6Patch release v0.6.6
Description
Context
Research (2026-03-24): VentureBeat article on testing autonomous agents proposes risk-unit action budgets alongside monetary cost. Deep dive revealed a clear gap: risk assessment is per-action and stateless -- an agent can execute 50 MEDIUM-risk actions in a row with no escalation.
Current State
RiskClassifiermaps ~25ActionTypevalues to 4ApprovalRiskLeveltiers (per-action, stateless)BudgetEnforcertracks only monetary cost (USD) with pre-flight/in-flight/task-boundary checks- Progressive trust gates tool access but does not accumulate risk
- No concept of cumulative risk tracking or risk budget exhaustion
- No shadow mode for pre-deployment calibration
Scope
Risk scoring model (security/risk_scorer.py)
RiskScorefrozen Pydantic model with 4 float dimensions (0.0-1.0):reversibility(inverse),blast_radius,data_sensitivity,external_visibility- Weighted sum produces scalar
risk_units: float RiskScorerprotocol (pluggable: static map, context-aware, or LLM-assisted)DefaultRiskScorerextends_DEFAULT_RISK_MAPto carryRiskScoreper action type
Cumulative risk tracker (budget/risk_tracker.py)
RiskRecord(agent_id, task_id, action_type, risk_units, timestamp)RiskTrackerparallel toCostTracker: append-only store,get_agent_risk(),get_task_risk(),get_total_risk()
Risk budget enforcement
- Extend
BudgetConfigwithrisk_budgetsection:per_task_risk_limit,per_agent_daily_risk_limit,total_daily_risk_limit, alert thresholds BudgetEnforcergainsRiskTrackerdependency, parallel risk checks alongside monetary checksRiskBudgetExhaustedError(subclass ofBudgetExhaustedError)- Opt-in:
risk_budget.enabled: falseby default
Shadow mode (security/config.py)
SecurityEnforcementModeenum:active/shadow/disabled- In shadow mode:
SecOpsServicelogs verdicts and risk accumulation but never blocks - Records what would have been escalated for calibration
Auto-downgrade integration
RISK_BUDGET_EXHAUSTEDadded toDowngradeReason- Progressive trust: agents consuming high risk units earn trust more slowly
Files
New:
src/synthorg/budget/risk_tracker.pysrc/synthorg/budget/risk_config.pysrc/synthorg/security/risk_scorer.py
Modified:
src/synthorg/budget/config.py,enforcer.py,errors.pysrc/synthorg/security/rules/risk_classifier.py,service.py,config.py,models.pysrc/synthorg/core/enums.pysrc/synthorg/engine/agent_engine.pydocs/design/operations.md
Deliverables
-
RiskScoremodel andRiskScorerprotocol with default implementation -
RiskTrackerwith cumulative per-agent/task/global tracking - Risk budget config and enforcement in
BudgetEnforcer - Shadow mode in
SecOpsService -
RISK_BUDGET_EXHAUSTEDdowngrade reason - Unit tests for risk scoring, tracking, enforcement, shadow mode
- Design spec update (
docs/design/operations.md)
Research
- Deep dive:
research/risk-unit-action-budgets.md(project memory) - Source: Testing Autonomous Agents (VentureBeat)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
prio:mediumShould do, but not blockingShould do, but not blockingscope:medium1-3 days of work1-3 days of workspec:budgetDESIGN_SPEC Section 10 - Cost & Budget ManagementDESIGN_SPEC Section 10 - Cost & Budget Managementspec:securityDESIGN_SPEC Section 12 - Security & Approval SystemDESIGN_SPEC Section 12 - Security & Approval Systemtype:featureNew feature implementationNew feature implementationv0.6Minor version v0.6Minor version v0.6v0.6.6Patch release v0.6.6Patch release v0.6.6