List all rules attached to a specific entity, ordered by priority.

## Path parameters

**`entity_type`** string required

Entity type: `assistant`, `user`, `model`, `vector_store`, `organization`

**`entity_id`** string required

The entity ID

## Query parameters

**`include_rule_details`** boolean optional

Include full rule content (default: false)

## Returns

Returns a list of rules attached to the entity, ordered by priority (highest first).


```bash
curl "https://api.aitronos.com/v1/rules/entities/assistant/asst_abc123/rules?include_rule_details=true" \
  -H "X-API-Key: $FREDDY_API_KEY"
```


```python Python SDK
from aitronos import Aitronos

client = Aitronos(api_key="your-api-key")

result = client.entity_rules.list_entity_rules("assistant", "asst_abc123", include_rule_details=True)
print(f"Found {len(result.data)} rules")
```


```python
import os
import requests

api_key = os.environ["FREDDY_API_KEY"]

response = requests.get(
    "https://api.aitronos.com/v1/rules/entities/assistant/asst_abc123/rules",
    headers={"X-API-Key": api_key},
    params={"include_rule_details": "true"}
)

rules = response.json()
print(f"Found {len(rules['data'])} rules attached to this assistant")
```


```javascript
const apiKey = process.env.FREDDY_API_KEY;

const response = await fetch(
  'https://api.aitronos.com/v1/rules/entities/assistant/asst_abc123/rules?include_rule_details=true',
  {
    headers: {
      'X-API-Key': apiKey
    }
  }
);

const rules = await response.json();
console.log(`Found ${rules.data.length} rules attached to this assistant`);
```

**Response** `200 OK`


```json
{
  "success": true,
  "data": [
    {
      "attachment": {
        "rule_id": "rule_a1b2c3d4",
        "entity_type": "assistant",
        "entity_id": "asst_abc123",
        "priority": 90,
        "character_limit": 1000,
        "is_active": true
      },
      "rule": {
        "id": "rule_a1b2c3d4",
        "name": "Professional Communication",
        "content": "Always maintain professional tone...",
        "category": "professional",
        "rule_type": "behavior",
        "is_active": true
      }
    },
    {
      "attachment": {
        "rule_id": "rule_e5f6g7h8",
        "entity_type": "assistant",
        "entity_id": "asst_abc123",
        "priority": 70,
        "character_limit": 2000,
        "is_active": true
      },
      "rule": {
        "id": "rule_e5f6g7h8",
        "name": "Safety Guidelines",
        "content": "Follow safety protocols...",
        "category": "safety",
        "rule_type": "guardrails",
        "is_active": true
      }
    }
  ]
}
```

## Related Resources

- [Create Rule](/docs/api-reference/rules/create)
- [List Rules](/docs/api-reference/rules/list)