Spectre.ActionProtection (Spectre v0.3.0)

Copy Markdown View Source

Matches action effects against agent protect declarations.

Protection is action-centric. A dangerous action must be protected whether it came from a deterministic DSL action/2 handler or from an optional planner inspecting an LLM reply.

Summary

Functions

Returns the policy protecting an action, if any.

Returns the matching policy in the active route scope.

Functions

protected_by(agent, effect)

@spec protected_by(module(), Spectre.Effect.t()) :: term()

Returns the policy protecting an action, if any.

:confirm_delete = Spectre.ActionProtection.protected_by(agent, effect)

protected_by(agent, effect, scope)

@spec protected_by(module(), Spectre.Effect.t(), Spectre.Definition.scope() | nil) ::
  term()

Returns the matching policy in the active route scope.

Agent protections are global. Skill protections apply only to effects staged by that mounted Skill, preventing two Skills bound to the same concrete action from stealing each other's policy.