# Self-Hosted AI Agents for Deployments, in YAML

> Define AI agents in .temps/agents/*.yaml that run on new errors, deploys, cron or webhooks and open pull requests via Claude Code, Codex or OpenCode.

David Viejo · Published 2026-01-28 · Updated 2026-11-03 · 8 min read

Canonical: https://temps.sh/blog/temps-dev-ai-powered-deployments

Temps runs AI coding agents on your own server, defined in YAML files in your repository. An agent fires on a new error group, a deploy, a monitoring alert, a cron schedule, a webhook or a manual click, runs Claude Code, Codex or OpenCode in a sandbox against your repo, and delivers a pull request, a commit, an analysis or a log entry. Agents don't deploy or roll back anything themselves: the deliverable is code or a report that a person reviews.

## What Are Temps AI Agents?

Most tools that call themselves "AI-powered" give you a chatbot or autocomplete. Temps agents are background workers. Each one is a YAML file in `.temps/agents/` in your repository; on the next deploy, Temps reads the folder and stores the configuration for that project. When a trigger fires, Temps starts the configured AI CLI — `claude_cli`, `codex_cli` or `opencode` — streams its output, and records the run with its log and result. The schema lives in [`repo_config.rs`](https://github.com/gotempsh/temps/blob/main/crates/temps-core/src/repo_config.rs) in the open-source repo; agents have been in the release line since v0.1.0-beta.10.

The best-known agent is the interactive Autofixer, which turns an error group into a pull request; its full walkthrough is in [AI Autofixer: from error group to pull request](https://temps.sh/blog/ai-autofixer-error-group-to-pull-request). This post covers the general framework.

## Temps AI Agents vs CI Scripts vs GitHub Copilot Autofix

| Capability        | CI scripts               | GitHub Copilot Autofix                                                                                   | Temps AI agents                                                                                        |
| ----------------- | ------------------------ | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| What starts a run | Push, PR or schedule     | A code-scanning alert                                                                                    | New or regressed error, production or preview deploy, downtime or latency alert, cron, webhook, manual |
| Input             | Your repo                | CodeQL code-scanning (SAST) alerts                                                                       | Your repo plus the trigger's context, such as the error type and message                               |
| Output            | Whatever the script does | Suggested fix on the alert or PR                                                                         | Pull request, commit, analysis or log-only                                                             |
| Runs where        | Your CI provider         | GitHub                                                                                                   | Your own server, in a sandbox                                                                          |
| AI provider       | N/A                      | GitHub's                                                                                                 | Claude Code, Codex or OpenCode, with your own model choice                                             |
| Cost              | CI minutes               | Included with GitHub code scanning (Advanced Security / Code Security); no Copilot subscription required | Included in Temps (free to self-host); you pay your AI provider                                        |

Copilot Autofix and Temps agents aren't really rivals: Autofix fixes static-analysis findings in GitHub, while Temps agents react to what happens in production. Source for the Autofix details: [GitHub's documentation](https://docs.github.com/en/code-security/responsible-use/security-and-quality-ai-features), checked October 2026.

## Defining an Agent in YAML

An agent file names its triggers, its prompt, the CLI to run and what it should deliver:

```yaml
name: error-fixer
description: Detects and fixes new error groups automatically
on:
  error:
    new_issue: true
  schedule:
    cron: "0 */6 * * *"
system: |
  You are an automated error fixer. Analyze the error, find the root cause,
  write a fix, and open a pull request. Use {{error_type}} and {{error_message}}
  as context variables.
ai_provider: claude_cli
max_turns: 20
branch_prefix: fix/agent-
deliverable: pull_request
```

The fields that matter most:

- **`on`** — any combination of `error` (`new_issue`, `regression`), `deploy` (`production`, `preview`), `monitoring` (`downtime`, `latency_spike`), `schedule` (`cron`), `manual` and `webhook`. A webhook trigger gets its own token and `POST /api/agents/webhook/{token}` URL.
- **`system`** — the system prompt, with template variables such as `{{error_type}}` and `{{error_message}}`.
- **`ai_provider` / `ai_model`** — which CLI runs (`claude_cli` by default, `codex_cli` or `opencode`) and, optionally, which model inside it. Leave the model unset to use the CLI's default.
- **`deliverable`** — `pull_request`, `commit`, `analysis` or `log_only`.
- **Guard rails** — `max_turns`, `timeout_seconds`, `daily_budget_cents` and `cooldown_minutes` cap how long and how often an agent runs and what it may spend.
- **`sandbox`**, **`mcp_servers`**, **`skills`** — run in a sandbox (or override the global setting), attach [MCP servers](https://temps.sh/docs/mcp-servers) registered in Temps, and load skills into the agent's `.claude/skills/` directory. Secrets for sandboxed runs are covered in [agent sandbox secrets](https://temps.sh/docs/agent-sandbox-secrets).

## Why Run Agents Next to Your Deployments?

When an agent runs inside a third-party service, it sees only what that service's API exposes. A Temps agent is started by the same platform that tracked the error, ran the deploy or fired the alert, so the trigger already carries that context into the prompt, and it runs on your server, so your code and prompts don't leave your infrastructure except for the calls to the AI provider you chose.

What it doesn't do is act on production. There is no rollback trigger or deploy action: Temps itself never rolls back automatically after a successful deploy (a deploy that fails its health checks simply never takes traffic), and an agent's output goes through a pull request and your normal deploy flow.

## Getting Started

Temps is licensed MIT / Apache 2.0. Self-hosting is free — you only pay for the server you already run it on. Temps Cloud, a hosted control plane for your own servers, is $29/month in an invite-only beta.

```bash
# Install Temps on your server
curl -fsSL https://temps.sh/deploy.sh | bash

# Deploy your app
bunx @temps-sdk/cli deploy --project my-app -b main -e production -y

# Add an agent to your repo and push — Temps picks it up on the next deploy
mkdir -p .temps/agents
cat > .temps/agents/error-fixer.yaml << 'EOF'
name: error-fixer
on:
  error:
    new_issue: true
system: |
  Analyze this error and open a pull request with a fix.
ai_provider: claude_cli
max_turns: 15
branch_prefix: fix/agent-
deliverable: pull_request
EOF
git add .temps/agents/error-fixer.yaml && git commit -m "feat: add error-fixer agent" && git push
```

The errors that trigger it come from Temps' built-in [error tracking](https://temps.sh/error-tracking), which accepts your existing Sentry SDK. For running agents and their sandboxes more broadly, see [Temps for AI agents](https://temps.sh/agents).

---

## What Temps Replaces

Temps is a single Rust binary that replaces seven SaaS tools:

| Tool    | Replaced by                                        |
| ------- | -------------------------------------------------- |
| Vercel  | Temps git-push deployments + Pingora proxy         |
| PostHog | Temps web analytics and session replay             |
| Sentry  | Temps error tracking (which can trigger agents)    |
| Pingdom | Temps uptime monitoring (which can trigger agents) |
| Datadog | Temps OpenTelemetry traces, metrics and logs       |
| Resend  | Temps transactional email                          |
| E2B     | Temps sandboxes for AI agents                      |

Managed Postgres, Redis, MongoDB and S3-compatible storage come on top. Because errors, deploys and monitors live in the same platform as the agents, wiring an agent to them is a few lines of YAML rather than a webhook integration between vendors.

---

Source: https://temps.sh/blog/temps-dev-ai-powered-deployments · Index of all pages: https://temps.sh/llms.txt
