pub struct CoderPolicy {
pub chain: InspectorChain,
pub credentialed_contract_chain: InspectorChain,
pub denied_tools: BTreeSet<String>,
}Expand description
Build the standard coder chain plus every operator-authored policy that governs this session.
The source order deliberately matches car_policy::tool_gate: machine-wide
rules first, then rules committed with the project. All current rule kinds
are prohibitions, so merging cannot relax a built-in or an earlier rule.
Built-ins remain ahead of the declarative inspector because first-Deny-wins
decides which actionable reason the model sees.
Tool names stay exact. A policy for a surface-specific tool the coder does
not expose (for example Claude Code’s WebFetch) is loaded but has nothing
to match; CAR does not guess aliases between tools with different schemas.
Stateful trace_rule is also deliberately excluded: the shared loader
rejects it as unenforced instead of silently claiming it took effect.
The chain, plus the tools the operator’s rules forbid outright.
Both come from one load of the policy files. The denied set is returned
rather than left inside the chain because it answers a question dispatch
cannot: which tools should never have been offered to the model in the first
place. See car_policy::PolicyEngine::blanket_denied_tools.
Fields§
§chain: InspectorChain§credentialed_contract_chain: InspectorChain§denied_tools: BTreeSet<String>Auto Trait Implementations§
impl !RefUnwindSafe for CoderPolicy
impl !UnwindSafe for CoderPolicy
impl Freeze for CoderPolicy
impl Send for CoderPolicy
impl Sync for CoderPolicy
impl Unpin for CoderPolicy
impl UnsafeUnpin for CoderPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more