Connect
Connect Capy from the terminal. Pass --help for the flags Capy accepts.
polylane integration connect --type capyAn API key from Settings → API in Capy.
Connect Capy to let Capy cloud agents write the fixes that Polylane finds. Polylane investigates the issue and confirms the root cause. Capy writes the change and opens the pull request on your GitHub. You use your own Capy API access.
- In Capy, go to Settings → API and create an API key. The key starts with
capy_. - Make sure that each repository you want fixed belongs to a Capy project.
- Paste the key into Polylane.
When you connect Capy, it becomes the executor for every autofix of the workspace. To send autofixes back to Polylane's own agent, turn off Use Capy for all autofixes on the Capy integration page in Settings.
Polylane encrypts the key before it stores it, and the agent never sees it.
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.
- In a Capy project, open Settings → MCP servers and click New MCP server.
- Choose HTTP and set the URL to
https://mcp.polylane.com/mcp. - Add an
Authorizationheader with the valueBearer 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 reports | What to do |
|---|---|
| The repository is not in a Capy project | Add the repository to a project in Capy. |
| Capy did not finish in the time limit | Give Capy a smaller task. |
| The Capy thread was archived | Do not archive a thread while Polylane follows it. |
| Capy refused the model | Turn on the key for that model in the Capy settings, then verify the integration in Polylane. |
| Capy refused the key | Create 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.
polylane integration disconnect <id>