API referenceConsole
code agent
Polylane investigates the issue and hands the fix to Capy cloud agents, which implement it and open the pull request on your GitHub. Bring your own API key.

Connect

Connect Capy from the terminal. Pass --help for the flags Capy accepts.

Terminal
polylane integration connect --type capy

How it works

Polylane hands the fix to Capy

When a fix run confirms the root cause of an issue, Polylane writes a brief: the root cause, the change to make, and how to check it. Every brief tells Capy to run the typecheck, the lint and the tests of the repository, and to list each check in the pull request description. A fix from a chat thread also includes the change that Polylane wrote in its sandbox.

Before Capy starts, Polylane applies the same gates as for its own fixes: the autofix switch, the autofix quota, a fix already in progress, and an open pull request for the same fix.

Then Polylane finds the Capy project that holds the repository and starts one thread in it, with the brief as the first message. The brief tells Capy to work only in that repository. Polylane names one fixed model for every thread.

Code hosts

Capy works only with GitHub repositories. For a repository on GitLab, Polylane writes the fix in its own sandbox.

The pull request comes back

Polylane reads the thread every three minutes, for a maximum of six hours. Polylane accepts a pull request only when Capy opened it from this thread: the pull request must carry the Capy badge with a link to the thread. Polylane then records it on the autofix and adds a section with its evidence and the history of the fix. If the thread stops without a pull request, Polylane records the autofix as skipped.

When a run fails

If the thread fails, Capy archives it, or Capy does not finish in six hours, Polylane's own agent takes the fix and writes it. If Polylane cannot reach Capy for about fifteen minutes, the run stops and Polylane's agent takes over. A run that opened a pull request always counts as a success.

If Capy refuses the key, or refuses the model because its key is off in Capy, Polylane sends one notice and gives new fixes to its own agent until you correct it and verify the integration.

Give Capy Polylane's MCP tools

A Capy thread can read Polylane while it writes a fix: issues, the infrastructure graph and observability data. Create an API key in Polylane under Settings → Coding agents. The key gets every read scope that the MCP tools check, plus edits to Polylane's own data. It cannot act on your cloud or on connected providers.

  1. In a Capy project, open Settings → MCP servers and click New MCP server.
  2. Choose HTTP and set the URL to https://mcp.polylane.com/mcp.
  3. Add an Authorization header with the value Bearer YOUR_API_KEY. Paste the full key.

Troubleshooting

When a Capy run fails, Polylane's own agent writes the fix. To let Capy do the next fix, correct the cause:

What Polylane reportsWhat to do
The repository is not in a Capy projectAdd the repository to a project in Capy.
Capy did not finish in the time limitGive Capy a smaller task.
The Capy thread was archivedDo not archive a thread while Polylane follows it.
Capy refused the modelTurn on the key for that model in the Capy settings, then verify the integration in Polylane.
Capy refused the keyCreate a new API key and reconnect Capy.

Keep the Capy badge in pull request descriptions. Without it, Polylane cannot prove which thread opened the pull request and does not record it.

Disconnecting

Disconnect Capy in Polylane, then revoke the API key in Capy. After you disconnect, Polylane's own agent writes new fixes.

Disconnect

Disconnecting stops every sync and check and deletes the credentials Polylane held. Everything Polylane set up in Capy is removed as well; nothing is left behind.

Terminal
polylane integration disconnect <id>