> ## 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**](../modules/config) module.

<Badge color="blue">AI Agent</Badge>

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

<ResponseField name="max_attachment_bytes" type="int">
  No description available.
</ResponseField>

<ResponseField name="max_attachments" type="int">
  No description available.
</ResponseField>

<ResponseField name="chunk_bytes" type="int">
  No description available.
</ResponseField>

<ResponseField name="allowed_types" type="List[str]">
  No description available.
</ResponseField>

## Methods

<CardGroup cols={2}>
  <Card title="enabled()" icon="function" href="../functions/AttachmentConfig-enabled">
    Whether the gateway advertises any attachment capacity.
  </Card>

  <Card title="to_policy()" icon="function" href="../functions/AttachmentConfig-to_policy">
    Build the policy fragment advertised in `HelloResult.policy`.
  </Card>
</CardGroup>

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

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/config.py#L847">
  `praisonaiagents/gateway/config.py` at line 847
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Configuration Overview" icon="gear" href="/docs/docs/configuration/index" />

  <Card title="Agent Config" icon="robot" href="/docs/docs/configuration/agent-config" />
</CardGroup>
