Files
codex/codex-rs/execpolicy/src/lib.rs
T
Charlie Marsh 5bdb5e8b3c Split in-memory execution policy rules into a separate crate (#62615)
## Why

Configuration, protocol, and prompt code use in-memory policies and
previously pulled in the Starlark parser through `codex-execpolicy`.

## What changed

Move policy construction, rule validation, and evaluation into
`codex-execpolicy-rules` and use it directly from those crates. Keep
Starlark policy loading and file updates in `codex-execpolicy`, which
re-exports the shared rule types and wraps rule validation errors while
preserving their source locations.

GitOrigin-RevId: 5bc70d3cd387b43a3ad1fcc56af96ad169ac8b13
2026-11-19 22:32:56 +00:00

32 lines
1.2 KiB
Rust

pub(crate) mod amend;
pub(crate) mod error;
pub(crate) mod execpolicycheck;
pub(crate) mod parser;
mod sandbox_migration;
pub use amend::AmendError;
pub use amend::blocking_append_allow_prefix_rule;
pub use amend::blocking_append_network_rule;
pub use codex_execpolicy_rules::Decision;
pub use codex_execpolicy_rules::Error as RuleError;
pub use codex_execpolicy_rules::ErrorLocation;
pub use codex_execpolicy_rules::Evaluation;
pub use codex_execpolicy_rules::MatchOptions;
pub use codex_execpolicy_rules::NetworkRuleProtocol;
pub use codex_execpolicy_rules::PatternToken;
pub use codex_execpolicy_rules::Policy;
pub use codex_execpolicy_rules::PrefixPattern;
pub use codex_execpolicy_rules::PrefixRule;
pub use codex_execpolicy_rules::RequirementsExecPolicy;
pub use codex_execpolicy_rules::Rule;
pub use codex_execpolicy_rules::RuleMatch;
pub use codex_execpolicy_rules::RuleRef;
pub use codex_execpolicy_rules::TextPosition;
pub use codex_execpolicy_rules::TextRange;
pub use codex_execpolicy_rules::rule;
pub use error::Error;
pub use error::Result;
pub use execpolicycheck::ExecPolicyCheckCommand;
pub use parser::PolicyParser;
pub use sandbox_migration::prefix_rule_migration;