> ## Documentation Index
> Fetch the complete documentation index at: https://qovery-docs-new-messaging-and-agent-tasks.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Tasks

> Configure AI agents that run as jobs on your Qovery infrastructure

<Warning>
  **Alpha.** Agent Tasks is in early development and not yet generally available. Capabilities and setup will change before release.
</Warning>

## Overview

Agent Tasks are one-time or scheduled jobs delegated to AI agents, running on your Qovery-managed infrastructure like any other service. Each agent runs with its own resources, environment variables, and a domain allowlist controlling exactly what it can reach.

## Creating an Agent

<Steps>
  <Step title="Add Context (Optional)">
    Connect a Git repository for the agent to load as context.
  </Step>

  <Step title="Choose a Provider">
    Only Anthropic is supported today, with your own API key.
  </Step>

  <Step title="Add MCP Servers (Optional)">
    Qovery's own MCP server is not added automatically, add it manually (`https://mcp.qovery.com/mcp`), or connect any remote HTTPS MCP server with its own name, URL, and headers. Authenticate with an API token or an [API Policy Token](/configuration/organization/api-policy-token) for scoped access. MCP servers added here are shared with every agent task in the organization, and can also be managed from **Organization Settings > AI settings > Agents**.
  </Step>

  <Step title="Write Instructions">
    Describe the agent's role and the steps it should follow in plain text. Reference credentials by the environment variable names you configure below, for example `INCIDENT_IO_API_KEY`.
  </Step>

  <Step title="Add Automations">
    Trigger the agent automatically and optionally send its result somewhere when it's done. See [Automations](#automations) below.
  </Step>
</Steps>

## Automations

An automation needs at least one trigger, and can optionally send its result to one or more outputs.

### Triggers

* **On a schedule**: a cron expression and timezone, for example `0 8 * * 1-5` for 8:00 AM, Monday through Friday.
* **From a webhook**: Qovery generates a unique URL for the agent task, visible later in the environment's **Agent Tasks** list (for example `https://webhook.qovery.com/api/v1/hook/...`). Anything that can send a POST request to that URL starts the agent.

### Outputs

Send the automation's result to a webhook: a destination URL, custom headers, and a prompt describing how to shape the result before sending it.

For example, to post the result to a Slack channel:

<Steps>
  <Step title="Create a Slack Incoming Webhook">
    In Slack, add the **Incoming Webhooks** app to the channel and copy the generated URL (`https://hooks.slack.com/services/...`).
  </Step>

  <Step title="Add the output in Qovery">
    In **Add output**, paste that URL into **Webhook URL**. No custom headers are needed, Slack's incoming webhooks accept a plain JSON POST.
  </Step>

  <Step title="Write the prompt">
    In **Prompt**, describe the message you want, for example: "Summarize the result as a short Slack message with the root cause and the recommended next step."
  </Step>
</Steps>

<Info>
  The Incident Analyser template uses a different, more direct pattern: it stores the Slack Incoming Webhook URL as a secret (`SLACK_WEBHOOK_URL`), adds `hooks.slack.com` to the domain allowlist, and instructs the agent to post to it directly as one of its own steps. Use this pattern when the agent itself, not just the automation's final output, should decide when and what to post.
</Info>

## Configuration

<AccordionGroup>
  <Accordion title="General Settings" icon="sliders">
    A description of what the agent does.
  </Accordion>

  <Accordion title="Resources" icon="gauge-high">
    CPU (mCPU), memory (MB), and storage (GB) allocated to the agent, same as any other Qovery service.
  </Accordion>

  <Accordion title="Governance" icon="shield-check">
    A domain allowlist controls which external hosts the agent task can reach: comma-separated hostnames, or `*` for all domains.
  </Accordion>

  <Accordion title="Environment Variables" icon="key">
    Plain variables or encrypted secrets the agent's instructions can reference by name. Secret values can't be viewed again once set.
  </Accordion>

  <Accordion title="Advanced Settings" icon="code-branch">
    A Dockerfile fragment lets you install additional CLIs or binaries in the agent's runtime before it starts.
  </Accordion>
</AccordionGroup>

## After You Create It

Agent Tasks appear in your environment overview under **Agent Tasks**, jobs delegated to AI agents, run once or on a schedule. Each one lists its status, last operation, underlying model, and a dedicated webhook URL you can call to trigger it from outside Qovery. That same webhook URL is also shown on the agent task's own overview page.

## Related Resources

<CardGroup cols={2}>
  <Card title="Incident Analyser" icon="triangle-exclamation" href="/configuration/agent-tasks/incident-analyser">
    Ready-made agent that correlates a firing incident with recent changes, logs, and metrics
  </Card>

  <Card title="Build & Deployment Optimizer" icon="gauge" href="/configuration/agent-tasks/build-deployment-optimizer">
    Ready-made agent that proposes faster, cheaper build and deployment configurations
  </Card>

  <Card title="Agent Tasks Overview" icon="robot" href="/getting-started/agent-tasks">
    Use cases and ready-made agent templates
  </Card>

  <Card title="Environment Variables" icon="key" href="/configuration/environment-variables">
    Manage configuration and secrets for your services
  </Card>
</CardGroup>
