# How to use Sazabi with Replicas: from production root cause to pull request

Connect Sazabi and Replicas so diagnosed production issues go straight to a cloud coding agent, and workspaces can query live production logs over MCP.

- Published: 2026-11-23
- Canonical: https://replicas.dev/resources/sazabi-with-replicas

[Sazabi](https://www.sazabi.com) watches production logs, groups failures into issues, and writes a root-cause report with supporting evidence. [Replicas](https://replicas.dev) runs coding agents such as Claude Code, Codex, Cursor, OpenCode, and Pi inside isolated cloud workspaces with your repositories and tools.

Connecting the two closes the gap between finding a production bug and opening a tested pull request. You can hand a diagnosed Sazabi issue straight to a Replicas agent, let a Replicas workspace query live Sazabi logs over MCP, or let Sazabi's own agent spin up and steer Replicas workspaces.

How a production issue moves from Sazabi to a Replicas pull request.

| Step | Who | Where | What happens | Detail |
| --- | --- | --- | --- | --- |
| 1 | Sazabi | Production logs | Finds an issue and writes a root-cause report | Reads logs and code to summarize what broke, why, and the supporting evidence |
| 2 | Fix handoff | Dashboard, CLI, or Auto-fix | Sends the issue to Replicas | `sazabi issues fix "$ISSUE_ID" --agent replicas` |
| 3 | Replicas | Isolated cloud workspace | Runs a coding agent on your repository | Edits code, runs tests, and optionally queries live Sazabi logs over MCP |
| 4 | Issue thread & GitHub | Pull request | Streams updates and links the pull request | Progress, questions, and the PR appear in the Sazabi issue thread |

| Side | Responsibilities |
| --- | --- |
| What Sazabi handles | Continuous log monitoring, root-cause analysis, the issue thread, and pull request status tracking |
| What Replicas handles | The isolated cloud VM, repository and environment setup, coding agent execution, and opening the pull request |

## Choose how to connect Sazabi and Replicas

Sazabi and Replicas support three separate connections. Each has its own setup, credentials, and direction of traffic, and turning on one does not turn on the others.

| Connection | Direction | Best for | Credential | Where you set it up |
| --- | --- | --- | --- | --- |
| **Core integration (Fix handoff)** | Sazabi → Replicas | Sending a diagnosed issue to a Replicas coding agent from **Fix**, the CLI, or Auto-fix | Replicas organization API key | Sazabi **Settings → Integrations → Replicas** |
| **Sazabi MCP or native plugin** | Replicas → Sazabi | Querying live production logs, reading issues, or asking the Sazabi agent from inside a Replicas workspace | Sazabi OAuth sign-in | Replicas **Environment → Tools** (Suggested MCPs) or **Organization → Integrations** |
| **Replicas MCP connector** | Sazabi agent → Replicas | Letting Sazabi's agent create workspaces, send messages, read chat history, or manage automations from any thread | Replicas organization or personal API key | Sazabi **Settings → MCP connectors → Replicas** |

Most teams start with the **Core integration** so engineers can hand off issues from Sazabi with one click. Adding the **Sazabi MCP** to the same Replicas environment is a useful second step because the coding agent can then check live production logs to confirm the error is still occurring before it writes a fix.

## Hand off a Sazabi issue to Replicas

The core integration registers Replicas as a coding agent inside Sazabi. When someone chooses **Fix** on an open issue, Sazabi sends the root-cause report to a Replicas workspace, streams the agent's progress and questions into the issue thread, and links the resulting pull request back to the issue.

### Prerequisites

- **Replicas GitHub integration:** Install GitHub in [Replicas Integrations](https://app.replicas.dev/dashboard/integrations/github) and add each repository you want fixed to a Replicas [environment](https://docs.replicas.dev/features/environments). Replicas only accepts fixes for repositories its GitHub integration can reach.
- **Replicas organization API key:** Ask a Replicas organization admin to create one in [Settings → API Keys](https://app.replicas.dev/dashboard/settings?tab=api-keys).
- **Sazabi organization admin access:** Required to add an organization-level integration in Sazabi.

### Connect in the dashboard

1. In Replicas, create an organization API key under [Settings → API Keys](https://app.replicas.dev/dashboard/settings?tab=api-keys).
2. In Sazabi, open [Settings → Integrations](https://app.sazabi.com/settings/integrations), select **Replicas**, and choose **Connect**.
3. Paste the API key. Sazabi verifies the key with Replicas before saving the connection.
4. Check the **Repositories** list on the connection page to confirm Replicas can reach the repositories you expect.
5. Optional: open a Sazabi project's **Integrations** settings, select **Replicas**, and pick a **Default environment** for fixes. Under [Settings → Code](https://app.sazabi.com/settings/code-search), you can also set Replicas as the project's **Default coding agent** and turn on **Auto-fix new issues** above a minimum severity threshold.

### Connect with the Sazabi CLI

With the [Sazabi CLI](https://docs.sazabi.com/reference/cli/integrations) installed and authenticated, run the following in Bash. Enter your Replicas API key at the hidden prompt so it is not stored in shell history:

```bash
read -rs -p "Replicas API key: " REPLICAS_API_KEY
printf '\n'
sazabi integrations connect replicas \
  --credentials "{\"apiKey\":\"$REPLICAS_API_KEY\"}"
sazabi integrations list
```

### Start and steer a fix

From the Sazabi dashboard, open an issue and select **Fix**. Pick **Replicas** if it is not already the project default, confirm the repository, base branch, and environment if prompted, and choose **Fix with Replicas**. The attempt appears in the issue thread, where you can answer the agent's questions and open the linked pull request.

From the CLI, sign in as a person with `sazabi auth sign-in` (Fix records the requester and rejects organization secret keys), then dispatch and follow the fix:

```bash
sazabi issues fix "$ISSUE_ID" --agent replicas
sazabi agent-dispatches list --issue-id "$ISSUE_ID"
```

If the agent asks a question or you want to steer its approach, reply to or cancel the dispatch directly from the terminal using the dispatch ID printed when the fix started:

```bash
sazabi agent-dispatches reply "$DISPATCH_ID" --text "Use the retry helper in lib/http.ts"
sazabi agent-dispatches cancel "$DISPATCH_ID"
```

Pull requests opened through **Fix** are linked to the Sazabi issue automatically. If you instead paste an issue's agent prompt into a separate Replicas workspace, include `Sazabi-Issue: <ISSUE_ID>` in the pull request body or run `sazabi issues link-pr "$ISSUE_ID" <pr-url>` so the issue tracks the fix.

## Query Sazabi logs from a Replicas workspace

When work starts outside Sazabi—from Slack, Linear, GitHub, or the Replicas dashboard—or when an agent working on a Fix wants to check whether an error is still firing, give the workspace direct access to Sazabi.

| Option | Endpoint / interface | When to pick it | Setup in Replicas |
| --- | --- | --- | --- |
| **Suggested MCP server** | `https://mcp.sazabi.com/mcp` | Fastest way for any coding agent in an environment to call Sazabi tools directly | Open **Environments → your environment → Tools**, choose **Sazabi** under Suggested MCPs, and sign in with Sazabi OAuth |
| **Native Sazabi plugin** | `replicas.sazabi.call(...)` via `@replicas/sdk` | When you want workspace scripts, automations, or skills to call Sazabi programmatically | Open **Organization → Integrations**, install **Sazabi**, and sign in with Sazabi OAuth |

Neither option is required for the Fix handoff, and you can enable one or both without changing your Sazabi integration settings.

## Let the Sazabi agent steer Replicas over MCP

Some investigations start in a Sazabi thread that is not an issue, or need Sazabi's own agent to inspect Replicas environments, read an active workspace's chat history, or trigger an automation. For that workflow, connect Replicas' hosted MCP server (`https://api.replicas.dev/v1/mcp`) as a Sazabi MCP connector.

- **Dashboard:** Open [Settings → MCP connectors](https://app.sazabi.com/settings/mcp-connectors), select **Replicas**, and paste a Replicas API key.
- **CLI:** Connect in one command and verify the discovered tools:

```bash
sazabi mcp-connectors connect replicas \
  --header "Authorization=Bearer $REPLICAS_API_KEY"
```

Choose the API key scope based on how you want Sazabi's agent to act:

- **Organization API key** ([Settings → API Keys](https://app.replicas.dev/dashboard/settings?tab=api-keys)): Acts as the Replicas bot across organization environments.
- **Personal API key** ([Personal → API Keys](https://app.replicas.dev/dashboard/account/api-keys)): Acts as you, including access to your personal environments and automations.

Sazabi also provides a per-connection **read-only** toggle on the MCP connector if you want Sazabi's agent to inspect workspaces and environments without creating replicas or merging pull requests.

## Common setup issues

| What you see | Likely cause | How to fix it |
| --- | --- | --- |
| `Replicas did not accept this key` | The API key is wrong, revoked, or from a different organization | Create a new organization key in Replicas **Settings → API Keys** and reconnect in Sazabi |
| `Replicas can't reach any repositories yet` | The GitHub integration is missing or the repository is not in an environment | Install GitHub in Replicas **Integrations** and add the repository to an environment |
| **Fix** does not offer Replicas | The connection is inactive or the project's repository is not reachable by Replicas | Check **Settings → Integrations** in Sazabi and confirm the repository appears under **Repositories** |
| `signed_in_person_required` when running Fix via CLI or API | Authenticated with an organization secret key instead of a personal login | Run `sazabi auth sign-in` so the fix dispatch is tied to a signed-in person |
| Creating a replica fails from the MCP connector | No coding agent is configured in Replicas | Configure at least one coding agent in Replicas **Organization → Coding Agents** |

## Further reading

- [Replicas docs: Hand off a Sazabi issue to Replicas](https://docs.replicas.dev/features/sazabi)
- [Sazabi docs: Replicas integration](https://docs.sazabi.com/catalogs/integrations/replicas)
- [Sazabi docs: Hand off a root cause](https://docs.sazabi.com/fix/hand-off)
- [Sazabi docs: Replicas MCP connector](https://docs.sazabi.com/catalogs/mcp-connectors/replicas)
- [Best AI SRE tools compared](/resources/ai-sre-tools)


## FAQ

### Do I need both the Sazabi Fix integration and the Sazabi MCP server?
No. They work independently. The core integration in Sazabi lets you hand diagnosed issues to Replicas with Fix, the CLI, or Auto-fix. The Sazabi MCP server or native plugin in Replicas lets workspaces query live Sazabi logs and issues. Many teams enable both so a coding agent fixing an issue can also verify live logs.

### Which coding agents can run a Sazabi fix in Replicas?
Any coding agent configured in your Replicas organization, including Claude Code, Codex, Cursor, OpenCode, and Pi. Replicas runs the agent inside the environment attached to the repository.

### Can Sazabi automatically hand off new production issues to Replicas?
Yes. In a Sazabi project under Settings → Code, set Replicas as the default coding agent, turn on Auto-fix new issues, and set the minimum severity threshold so lower-severity issues stay manual.

### Should I use a Replicas organization API key or a personal API key in Sazabi?
The core Fix integration expects a Replicas organization API key from Settings → API Keys. The Replicas MCP connector in Sazabi accepts either: an organization key acts as the Replicas bot across org environments, while a personal key acts as you and includes your personal environments and automations.

### Does a pull request from Replicas get linked back to the Sazabi issue automatically?
Yes when the fix is started through Sazabi Fix. If you instead paste an issue prompt into a separate Replicas workspace outside Fix, include Sazabi-Issue: <ISSUE_ID> in the pull request body or run sazabi issues link-pr to link it.
