Skip to main content

Module guard

Module guard 

Source
Expand description

Workflow guard – execution limits for agent workflows.

Prevents runaway workflows: unbounded sub-workflow depth, uncontrolled fan-out, unlimited token consumption, and infinite execution time. Checked before every agent step invocation.

§Examples

use ironflow_engine::guard::{WorkflowGuardConfig, WorkflowGuardState, WorkflowRejection};

let config = WorkflowGuardConfig::default();
assert_eq!(config.max_depth, 5);

let state = WorkflowGuardState::new();
assert!(state.check(&config, "agent-a").is_ok());

Structs§

WorkflowGuardConfig
Configurable execution limits for a workflow run.
WorkflowGuardState
Mutable runtime state tracked by the guard during a workflow execution.

Enums§

WorkflowRejection
Reason a workflow invocation was rejected by the guard.

Constants§

WORKFLOW_GUARD_REJECTED_CODE
Business error code for guard rejections.

Functions§

new_shared_guard_state
Create a new shared guard state for a workflow run.

Type Aliases§

SharedGuardState
Thread-safe handle to a shared WorkflowGuardState.