← All integrations
Modal

Modal integration. Find the Modal functions that fail or cost too much.

Polylane maps your Modal apps and functions, reads their logs, deployments and spend to find what broke or got expensive, and writes the fix in your code.

Why Polylane for Modal

Get started for free

How to set up Modal

The guide provides no measured total setup time. Both token fields must pass validation before discovery starts.

Paste this prompt into your coding agent. It installs the Polylane CLI if you need it, signs you in and connects Modal.

Here's what Polylane does with Modal: Polylane maps your Modal apps and functions, reads their logs, deployments and spend to find what broke or got expensive, and writes the fix in your code. I want that, so connect Modal to my Polylane workspace. If the Polylane CLI isn't installed or I'm not signed in, set that up first by following https://polylane.com/auth.md. Then connect Modal with `polylane cloud connect`: run `polylane cloud connect --help` to find the Modal option and its flags. If the CLI doesn't offer Modal, open https://console.polylane.com and walk me through connecting it there. The setup steps and the access Modal needs are at https://polylane.com/integrations/modal/. Ask me for anything you need, like a token or an approval in the browser. When you're done, run `polylane cloud list` and tell me whether Modal is connected.
Set it up by hand: steps, permissions and access
  1. Open Modal Settings → Tokens and create a token for the workspace you want to connect.
  2. Copy both the ak- token ID and as- token secret. Paste both into Modal’s connection form in Polylane.
  3. Validate and connect. One token resolves to one Modal workspace; repeat with a different token for another workspace.

Permissions and access

Modal has no read-only token option: the token inherits its creator’s account permissions. Polylane’s sync only reads Modal. There is no read-only/full-access choice in the connection form, and secret values are not exposed by Modal; only names are mapped.

Discovery, refresh and the connected view

Inventory refreshes every 15 minutes. Environments contain apps, functions and endpoints, running sandboxes, volumes, secrets, queues and dicts. Functions are discovered through deployed apps; finished sandboxes are skipped. App pages carry stderr-line and metered-spend charts. Stderr counts are lines, not failures, and logs are retained by Modal for 24 hours. Spend is attributed per app and the newest unfinished hour can read low.

Disconnect and revoke access

Disconnect the Modal account in Polylane, then revoke the token in Modal Settings → Tokens. A manual Sync refreshes inventory sooner than the next scheduled pass while connected.

Provider credentials and Polylane’s access mode are separate. Where write-capable tools exist, the connected account’s Settings page offers a Read-only switch. Turning it off permits writes subject to review and confirmation, but cannot add permissions to the provider credential. Agent-connected Kubernetes clusters stay read-only.

In the graph.

Every Modal resource Polylane picks up sits in the graph with its connections, config and history.

Environment
App
Function
Class
Sandbox
Image
Volume
Secret
Queue
Dict

Modal tools.

The calls Polylane can make to Modal when it looks into an issue.

Modal
  • modalGetLogs Get Modal app logs: per-bucket volume by stream plus sampled lines
  • modalListSandboxes List Modal sandboxes in an environment, with their state and resource shape
  • modalListDeployments List Modal app deployments: version, who deployed, and when
  • modalDescribeApp Describe one Modal app: state, deploy provenance, and the functions inside it
  • modalGetCost Get metered Modal spend, for one app or broken down across the workspace

All guides for Modal

Recent updates

All updates in the changelog

Common questions.

How does Polylane connect to my Modal workspace?

Open Modal Settings → Tokens and create a token for the workspace you want to connect. Copy both the ak- token ID and as- token secret. Paste both into Modal’s connection form in Polylane. Validate and connect. One token resolves to one Modal workspace; repeat with a different token for another workspace.

What Modal resources does Polylane sync?

Inventory refreshes every 15 minutes. Environments contain apps, functions and endpoints, running sandboxes, volumes, secrets, queues and dicts. Functions are discovered through deployed apps; finished sandboxes are skipped. App pages carry stderr-line and metered-spend charts. Stderr counts are lines, not failures, and logs are retained by Modal for 24 hours. Spend is attributed per app and the newest unfinished hour can read low.

Connect it once. Then get back to shipping.