# `Jido.AI.Skill.ResourcePolicy`
[🔗](https://github.com/agentjido/jido_ai/blob/v2.4.0/lib/jido_ai/skill/resource_policy.ex#L1)

Defines limits for skill resource listing and loading.

A policy bounds file count, directory traversal, the encoded general-resource
list, file size, and text returned to model context. Binary content is
rejected by default. Set `binary: :allow` to permit image and file attachments
through the generic resource loader. Text-only APIs always reject binary data.

# `t`

```elixir
@type t() :: %Jido.AI.Skill.ResourcePolicy{
  binary: :reject | :allow,
  max_depth: non_neg_integer(),
  max_directories: pos_integer(),
  max_file_bytes: pos_integer(),
  max_listing_bytes: pos_integer(),
  max_resources: pos_integer(),
  max_text_bytes: pos_integer()
}
```

# `default`

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

Returns the default resource policy.

# `new`

```elixir
@spec new(t() | keyword() | map()) :: {:ok, t()} | {:error, term()}
```

Builds and validates a resource policy.

The input can be a policy, a keyword list, or a map with atom keys.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Converts a policy to a plain map.

---

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