> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Attachment Config • AI Agent SDK

> AttachmentConfig: Attachment/media ceilings for the gateway wire protocol (Issue #5207).

# AttachmentConfig

> Defined in the [**config**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/config.md) module.

AI Agent

Attachment/media ceilings for the gateway wire protocol (Issue #5207).

The gateway is the control plane custom `/ws` clients build on, but the
`message` frame had no attachment contract and no per-attachment size/type
policy — only the whole-frame `max_payload`. These ceilings are advertised
to clients in the `hello` handshake (folded into `HelloResult.policy`) so
a well-behaved client self-limits — inlining small files, chunking larger
ones at `chunk_bytes` — instead of discovering the limit by being
disconnected. All fields are advisory limits; enforcement lives wherever the
gateway materialises attachments (a wrapper/bot concern).

Backward-compatible: attachments are opt-in per turn, and a client that
never sends one is unaffected by these values.

Attributes:
max\_attachment\_bytes: Largest single attachment (inline or stored) the
gateway accepts, in bytes. Default 10 MiB.
max\_attachments: Maximum number of attachments on one `message` turn.
chunk\_bytes: Advertised chunk size a client should use when streaming a
large file into the attachment store (reserve → put chunk → close).
allowed\_types: Optional allow-list of MIME types / prefixes (e.g.
`image/` or `application/pdf`). Empty (default) means no type
restriction is advertised.

## Properties

**max\_attachment\_bytes** `int`

No description available.

**max\_attachments** `int`

No description available.

**chunk\_bytes** `int`

No description available.

**allowed\_types** `List[str]`

No description available.

## Methods

> **[enabled()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/AttachmentConfig-enabled.md)**
>
> Whether the gateway advertises any attachment capacity.

> **[to\_policy()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/AttachmentConfig-to_policy.md)**
>
> Build the policy fragment advertised in `HelloResult.policy`.

> **Internal & Generic Methods**
>
> * **from\_dict**: Create from a parsed `gateway.attachments` mapping (tolerant of None).
> * **to\_dict**: Convert to dictionary.

## Source

> **[View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/config.py#L971)**
>
> `praisonaiagents/gateway/config.py` at line 971

***

## Related Documentation

> **[Configuration Overview](https://praison.ai/docs/docs/configuration/index)**

> **[Agent Config](https://praison.ai/docs/docs/configuration/agent-config)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.