Skip to main content

Monitoring Setup

Connect Slack and GitHub so your AI agents can watch for errors, triage them, and deploy fixes — all with human approval via SignedApproval.

Key Concepts

What it does

Clevername's agent monitoring loop lets you connect a Slack workspace and a GitHub repository so your AI agents can watch for errors, triage them, and deploy fixes — all without manual intervention. AlertTriageAgent reads your error channel on a schedule and posts structured triage reports. AlertFixAgent reads those reports, generates code fixes, and requests your approval via the SignedApproval app before dispatching a fix to your GitHub repo through Actions. Results land back in your notification channel.

What you need before setup

  • A Slack workspace with a bot connected — install via Integrations → Slack
  • A GitHub repo where your code lives — connect via Integrations → GitHub
  • AlertTriageAgent and AlertFixAgent active in your AI Company
Step-by-Step Guide
1

Set up via the UI

Go to AI Company and look for the Monitoring Setup card on the overview page. The card walks you through connecting Slack, selecting your error and notification channels, and linking your GitHub repo. Each step validates connectivity before letting you proceed.

Tip
If you prefer to configure this programmatically — or want an AI assistant to do it for you — continue reading the API and MCP sections below.
2

Set up via the REST API

All monitoring config endpoints are under /api/hub/hub/ai-company/monitoring/ and require a Supabase JWT in the Authorization header.

Check current status

Returns which pieces are connected and what is still missing. Always call this first to see what needs to be configured.

GET /api/hub/hub/ai-company/monitoring/status?org_id={org_id}
Authorization: Bearer {supabase_jwt}

// Response
{
  "slack_connected": true,
  "github_connected": false,
  "error_channel_configured": false,
  "notify_channel_configured": false,
  "github_repo_configured": false,
  "setup_complete": false,
  "missing": ["github_repo", "error_channel", "notify_channel"]
}
Response fields:
  • slack_connected — Slack OAuth connection exists for this org
  • github_connected — GitHub OAuth connection exists for this org
  • error_channel_configured — a Slack channel is set to receive error alerts
  • notify_channel_configured — a Slack channel is set to receive agent updates
  • github_repo_configured — a target GitHub repo is saved
  • setup_completetrue when all five are satisfied
  • missing[] — list of keys still needed

List Slack channels

Fetches all channels visible to the connected Slack bot. Use this to find the channel ID you need for the config step — do not guess or hardcode a name.

GET /api/hub/hub/ai-company/monitoring/slack/channels?org_id={org_id}
Authorization: Bearer {supabase_jwt}

// Response
{
  "channels": [
    { "id": "C0XXXXXXXX", "name": "errors" },
    { "id": "C0YYYYYYYY", "name": "clevername-errors" },
    { "id": "C0ZZZZZZZZ", "name": "general" }
  ]
}

Save config

Persists the monitoring configuration for the org. All fields are optional — only the fields you include are updated. The slack_error_channel_name and slack_notify_channel_name fields are for display only; the IDs are what the agents actually use.

PUT /api/hub/hub/ai-company/monitoring/config?org_id={org_id}
Authorization: Bearer {supabase_jwt}
Content-Type: application/json

{
  "slack_error_channel_id": "C0XXXXXXXX",
  "slack_error_channel_name": "#clevername-errors",
  "slack_notify_channel_id": "C0XXXXXXXX",
  "slack_notify_channel_name": "#clevername-errors",
  "github_repo": "owner/repo-name"
}

// Response
{
  "ok": true,
  "setup_complete": true
}
Note
Both channels can be the same Slack channel. The error channel is where your monitoring tools post incoming alerts; the notify channel is where agents post triage reports and fix confirmations. Keeping them separate is recommended for high-volume error environments.
3

Set up via your AI assistant

This is the recommended path for most users. Your AI assistant (Claude or any LLM connected to Clevername's MCP gateway) can check what's missing, look up the right Slack channel ID, and save the config for you — without you touching the UI or calling any APIs yourself.

Example prompt to give your assistant

"Set up my monitoring configuration. My error alerts go to #clevername-errors and I want agents to post updates there too. My GitHub repo is AlexFloyd13/clevername."

The assistant will call monitoring__get_status to see what's missing, then monitoring__list_slack_channels to resolve #clevername-errors to its channel ID, then monitoring__set_config to save everything. You will see each tool call happen in the chat before it runs — you can review and cancel at any step.

MCP tool reference

These tools are exposed through the Clevername MCP gateway. They are available to any LLM session that has the AI Company MCP server active.

monitoring__get_status

Returns the current setup status for the org — which integrations are connected and which config fields are still missing. Use this as the first step in any setup flow.

// Required
org_id: string   // The organization UUID

// Returns
{
  slack_connected: boolean,
  github_connected: boolean,
  error_channel_configured: boolean,
  notify_channel_configured: boolean,
  github_repo_configured: boolean,
  setup_complete: boolean,
  missing: string[]
}
monitoring__get_config

Returns the full saved config object for the org, including current channel IDs and names, GitHub repo, and whether monitoring is enabled.

// Required
org_id: string   // The organization UUID

// Returns
{
  slack_error_channel_id: string | null,
  slack_error_channel_name: string | null,
  slack_notify_channel_id: string | null,
  slack_notify_channel_name: string | null,
  github_repo: string | null,
  monitoring_enabled: boolean
}
monitoring__set_config

Saves the monitoring configuration. All non-org_id fields are optional; only the fields provided are updated. A tool like this is how your assistant saves the config after resolving channel IDs.

// Required
org_id: string                        // The organization UUID

// Optional (include only what you want to update)
slack_error_channel_id: string        // Slack channel ID for incoming error alerts
slack_error_channel_name: string      // Human-readable label (display only)
slack_notify_channel_id: string       // Slack channel ID for agent output posts
slack_notify_channel_name: string     // Human-readable label (display only)
github_repo: string                   // "owner/repo-name" format
monitoring_enabled: boolean           // Enable or pause the monitoring loop

// Returns
{ ok: true, setup_complete: boolean }
monitoring__list_slack_channels

Lists all Slack channels visible to the connected bot for this org. Use this to resolve a channel name like #clevername-errors to its stable channel ID before calling monitoring__set_config. Never hardcode a channel ID without confirming it with this tool.

// Required
org_id: string   // The organization UUID

// Returns
{
  channels: Array<{ id: string, name: string }>
}
4

How the monitoring loop runs

Once setup is complete and monitoring is enabled, the loop runs automatically on its configured schedule:

  1. AlertTriageAgent runs on schedule, reads your error channel via the Slack MCP server, and posts a structured triage report back to your notification channel.
  2. AlertFixAgent reads the triage report, analyzes the error context, and generates a proposed code fix against your configured GitHub repo.
  3. AlertFixAgent requests approval via SignedApproval — you receive a push notification in the SignedApproval app with a diff to review.
  4. You approve or reject the fix in the app. Approval dispatches AlertFixAgent to open a pull request in your GitHub repo via GitHub Actions.
  5. The outcome (PR link or rejection note) is posted back to your notification channel.
Note
The loop only runs if both AlertTriageAgent and AlertFixAgent are in active status in your AI Company. If either agent is paused or in draft, the corresponding step is skipped.