# `Jido.AI.Effects.Policy`
[🔗](https://github.com/agentjido/jido_ai/blob/v2.4.0/lib/jido_ai/effects/policy.ex#L1)

Effect policy definition and filtering for tool-emitted effects.

# `constraints`

```elixir
@type constraints() :: map()
```

# `matcher`

```elixir
@type matcher() :: module()
```

# `matcher_set`

```elixir
@type matcher_set() :: term()
```

# `mode`

```elixir
@type mode() :: :deny_all | :allow_all | :allow_list
```

# `t`

```elixir
@type t() :: %Jido.AI.Effects.Policy{
  allow: matcher_set(),
  constraints: constraints(),
  deny: matcher_set(),
  mode: mode()
}
```

# `allowed?`

```elixir
@spec allowed?(t(), term()) :: boolean()
```

Returns true when an effect is permitted by the policy.

# `default`

```elixir
@spec default() :: t()
```

Returns the default policy.

# `filter`

```elixir
@spec filter(t() | map() | keyword() | nil, [term()]) :: {[term()], [term()]}
```

Filters effects according to the policy.

Returns `{allowed, dropped}`.

# `intersect`

```elixir
@spec intersect(t() | map() | keyword() | nil, t() | map() | keyword() | nil) :: t()
```

Narrows an agent policy by a strategy policy.

# `new`

```elixir
@spec new(t() | map() | keyword() | nil) :: t()
```

Builds a policy from map/keyword input.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
