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

# Matrix Integration

> Set up decentralized Matrix chat gateways for remote agent control.

Hiroshi features a persistent HTTP long-polling synchronization loop targeting Matrix client sync endpoints. It decodes decentralized chat events to run secure local terminal utilities.

## ⚙️ Configuration Setup

Configure your Matrix homeserver access details in `~/.hiroshi/config.toml`:

```toml theme={null}
[matrix]
enabled = true
homeserver_url = "https://matrix.org"
user_id = "@hiroshi-agent:matrix.org"
access_token = "syt_your_access_token_here"
allowed_rooms = ["!roomid:matrix.org"]
```

## 🔐 Security Configuration

Matrix channels are federated and public by default. Ensure that you restrict permissions:

* Populate the `allowed_rooms` array to prevent the agent from joining unauthorized rooms.
* Set security policies inside `pairing` controls to require cryptographic pairing before processing messages.
