For AI agents: the complete documentation index is available at https://docs.flezise.com/llms.txt, the full documentation bundle is available at https://docs.flezise.com/llms-full.txt, and this page is available as Markdown at https://docs.flezise.com/sandboxes/preflight.md.

Preflight checks

Before an agent run begins, the platform can execute a suite of checks against the project repository inside the sandbox. These checks surface problems such as a broken build, failing tests, or a missing environment that would cause the agent to struggle from the start.

The check suite is run by swecli preflight run and produces a JSON report. The platform reads that report and makes it available in the session.

Modes

Preflight supports three modes, passed as --mode:

ModeWhat it checksTimeout
fastA quick environment and dependency scan.10 minutes
sessionThe standard pre-session check, including build and test smoke.10 minutes
prA fuller check intended for pull-request gates.20 minutes

The platform uses session mode by default (sandbox_preflight_required_mode).

When preflight runs

Preflight runs on demand through the session API. In a chat session, you can trigger it from the agent by asking it to run preflight, or the platform may run it automatically before handing control to the agent. The result is attached to the session and visible in the run record.

A completion gate is available but off by default (sandbox_preflight_completion_gate_enabled). When it is on, the platform requires preflight to pass before an implementation run is allowed to proceed.

Commands

Inside a sandbox, swecli exposes three preflight subcommands:

CommandPurpose
swecli preflight detectDetect what check frameworks are available in the workspace.
swecli preflight run --mode <mode>Run the checks and write a JSON report.
swecli preflight reportPrint the most recent saved report.

All three write output as JSON by default (--format json) and accept --format markdown for human-readable output.

Where results appear

The preflight report is a JSON object with a status field (passed, failed, or error) and per-check detail. When the platform triggers preflight on a session, the result is stored in the run record for that session and visible in Run History under the session's entry. An error result means the check runner itself malfunctioned, not that the project tests failed.

Note

Preflight runs inside the sandbox, so it sees the repository at the exact state the agent will start from. A passing result does not guarantee later agent work will succeed if the agent modifies the environment.

Next steps

  • Agent sandboxes: sandbox lifecycle and creation.
  • Runs: where run records and their attached evidence live.