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

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To act on Guild from an MCP client, connect to https://api.guild.ai/mcp (OAuth) or run `guild mcp` locally. Setup: https://docs.guild.ai/api-reference/mcp.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Manage Ably apps, keys, and rules from Guild agents

> Connect Guild agents to Ably to create and manage apps, API keys, namespaces, queues, and Reactor rules via the Ably Control API.

Integrations · Ably

A Guild agent can create, update, delete, and inspect Ably applications, API keys, namespaces, queues, and Reactor rules on your behalf. Guild stores your Ably API key server-side and injects it as a bearer token, so agent code never sees the credential. Credential policies let you restrict which operations each agent may call, and every request is auditable through Guild's credential proxy.

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use Ably.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect Ably to your first agent.

## What the Ably integration exposes

The integration provides tools that map to the Ably Control REST API at `control.ably.net/v1`. Tools cover application lifecycle, API key management and revocation, namespace and queue administration, Reactor rule configuration, APNs push notification settings, and account and token inspection. Each tool is prefixed `ably_` and can be selected individually with `pick()` from the [SDK tools](https://docs.guild.ai/sdk/tools.md).

## How it works

**1. Open credentials and connect**

In Guild, go to **Access & setup > Credentials**, click **Connect**, and select **ably**. Paste your Ably Control API key into the **API Key** field.

**2. Scope the credential**

By default the credential serves every workspace the account owns. See [Credentials](https://docs.guild.ai/platform/credentials.md) to scope it to one workspace, one member, or a single agent.

**3. Add tools to your agent**

Import `AblyTools` from `@guildai-services/guildai~ably` and spread it into your agent's `tools` object. Use `pick()` to include only the tools your agent needs.

## Why Ably access needs governing

Ably API keys can create and delete applications, revoke other keys, and configure Reactor rules that forward messages to external endpoints. An agent with unrestricted access to these operations could disrupt live channels or expose data. Guild's [credential policies](https://docs.guild.ai/platform/credential-policies.md) let you write `ALLOW` and `DENY` rules that the credential proxy enforces before any request leaves Guild, limiting agents to specific `ably_` operations or HTTP methods.

Credentials are injected server-side by Guild's proxy, so agent code never reads the key directly. You can scope a credential to one workspace, one member, or a single agent using [Credentials](https://docs.guild.ai/platform/credentials.md), and you can grant or revoke access at any time without redeploying agent code. Teams that share one Ably account but run agents in separate workspaces can restrict each workspace to its own scoped credential, keeping blast radius small.

## About the Ably integration

Agents can create, update, and delete Ably applications, API keys, namespaces, queues, and Reactor rules. They can also retrieve account and app details, revoke keys, and update APNs push notification settings. The integration is `guildai~ably`.

## Authentication

* **Type:** API key
* **Header:** Guild sends the key as a bearer token in the `Authorization` header

### Setup

**1. Connect Ably**

In Guild, go to **Access & setup > Credentials**, click **Connect**, select **ably**, and paste the key into **API Key**.

See [Credentials](https://docs.guild.ai/platform/credentials.md) for workspace, member, and agent-scoped credentials.

## Usage

```typescript theme={null}
import { AblyTools } from "@guildai-services/guildai~ably"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  systemPrompt: "You work with Ably.",
  tools: { ...AblyTools },
})
```

### Selecting specific tools

Tools are named with the `ably_` prefix. Use [`pick()`](https://docs.guild.ai/sdk/tools#selecting-specific-tools) to include only what your agent needs.

## Tools

Tools in the latest published version of `guildai~ably`:

| Tool | What it does |
| - | - |
| `ably_delete_apps_by_app_id_namespaces_by_namespace_id` | Deletes the namespace with the specified ID, for the specified application ID. |
| `ably_delete_apps_by_app_id_queues_by_queue_id` | Delete the queue with the specified queue name, from the application with the specified application ID. |
| `ably_delete_apps_by_app_id_rules_by_rule_id` | Deletes a Reactor rule |
| `ably_delete_apps_by_id` | Deletes the application with the specified application ID. |
| `ably_get_accounts_by_account_id_apps` | List all applications for the specified account ID. |
| `ably_get_apps_by_app_id_keys` | Lists the API keys associated with the application ID. |
| `ably_get_apps_by_app_id_namespaces` | List the namespaces for the specified application ID. |
| `ably_get_apps_by_app_id_queues` | Lists the queues associated with the specified application ID. |
| `ably_get_apps_by_app_id_rules` | Lists the rules for the application specified by the application ID. |
| `ably_get_apps_by_app_id_rules_by_rule_id` | Returns the rule specified by the rule ID, for the application specified by application ID. |
| `ably_get_me` | Get token details |
| `ably_patch_apps_by_app_id_keys_by_key_id` | Update the API key with the specified key ID, for the application with the specified application ID. |
| `ably_patch_apps_by_app_id_namespaces_by_namespace_id` | Updates the namespace with the specified ID, for the application with the specified application ID. |
| `ably_patch_apps_by_app_id_rules_by_rule_id` | Updates a Reactor rule |
| `ably_patch_apps_by_id` | Updates the application with the specified application ID. |
| `ably_post_accounts_by_account_id_apps` | Creates an application with the specified properties. |
| `ably_post_apps_by_app_id_keys` | Creates an API key for the application specified. |
| `ably_post_apps_by_app_id_keys_by_key_id_revoke` | Revokes the API key with the specified ID, with the Application ID. |
| `ably_post_apps_by_app_id_namespaces` | Creates a namespace for the specified application ID. |
| `ably_post_apps_by_app_id_queues` | Creates a queue for the application specified by application ID. |
| `ably_post_apps_by_app_id_rules` | Creates a rule for the application with the specified application ID. |
| `ably_post_apps_by_id_pkcs12` | Updates the application's Apple Push Notification service (APNs) information. |

## Frequently asked questions

> [accordion] Can an agent revoke an Ably API key it did not create?
>
> Yes. The `ably_post_apps_by_app_id_keys_by_key_id_revoke` tool revokes any API key by key ID and application ID, regardless of which process created it. Use a credential policy to restrict this operation to specific agents if needed.

> [accordion] Does the integration receive Ably webhook or realtime events?
>
> No. The catalog entry lists no webhook events for this integration. Agents interact with Ably through Control API calls only; they do not receive inbound events from Ably.

> [accordion] How does Guild keep my Ably key secure?
>
> Guild stores the key and sends it as a bearer token in the `Authorization` header server-side. Agent code never sees the credential; the key is injected only after the credential proxy checks the applicable [credential policies](https://docs.guild.ai/platform/credential-policies.md).

> [accordion] Can I let one agent manage Reactor rules but block it from deleting apps?
>
> Yes. Write a `DENY` rule targeting `ably_delete_apps_by_id` and an `ALLOW` rule for the Reactor rule operations, then scope both rules to that agent. Guild's credential proxy enforces the rules before any request reaches Ably. See [Credential policies](https://docs.guild.ai/platform/credential-policies.md) for syntax.

## Put a governed agent on Ably this week

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use Ably.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect Ably to your first agent.

## Related

**Also runs on Guild:** [Discord](https://docs.guild.ai/integrations/discord.md) · [Email](https://docs.guild.ai/integrations/email.md) · [Gmail](https://docs.guild.ai/integrations/gmail.md) · [SendGrid](https://docs.guild.ai/integrations/sendgrid.md)

**Read:** Docs: [Credential policies](https://docs.guild.ai/platform/credential-policies.md) · [Credentials](https://docs.guild.ai/platform/credentials.md) · [Tools in agents](https://docs.guild.ai/sdk/tools.md)
