> ## 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.

# To Policy • AI Agent SDK

> to_policy: Build the policy fragment advertised in ``HelloResult.policy``.

# to\_policy

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**AttachmentConfig**](../classes/AttachmentConfig) class in the [**config**](../modules/config) module.

Build the policy fragment advertised in `HelloResult.policy`.

Only advertises the attachment ceilings when enabled, so a gateway with
attachments disabled advertises exactly today's policy shape. The type
allow-list is included only when configured.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def to_policy() -> Dict[str, Any]
```

### Returns

<ResponseField name="Returns" type="Dict[str, Any]">
  The result of the operation.
</ResponseField>

## Source

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