Load exec policy rules from requirements (#10190)

`requirements.toml` should be able to specify rules which always run. 

My intention here was that these rules could only ever be restrictive,
which means the decision can be "prompt" or "forbidden" but never
"allow". A requirement of "you must always allow this command" didn't
make sense to me, but happy to be gaveled otherwise.

Rules already applies the most restrictive decision, so we can safely
merge these with rules found in other config folders.
This commit is contained in:
gt-oai authored and GitHub committed 2026-01-30 18:04:09 +00:00
1 parent 23db79fae2
commit 5662eb8b75
9 files changed
+398 -71

No files matched your search

+6
View File
@@ -18,6 +18,12 @@ pub enum ConstraintError {
#[error("field `{field_name}` cannot be empty")]
EmptyField { field_name: String },
#[error("invalid rules in requirements (set by {requirement_source}): {reason}")]
ExecPolicyParse {
requirement_source: RequirementSource,
reason: String,
},
}
impl ConstraintError {
+1
View File
@@ -1512,6 +1512,7 @@ impl Config {
approval_policy: mut constrained_approval_policy,
sandbox_policy: mut constrained_sandbox_policy,
mcp_servers,
exec_policy: _,
} = requirements;
constrained_approval_policy