Connecting Neon lets Trevize provision an isolated Postgres branch for every run. Each run gets a fresh read-write branch of your Neon project — so agents (and previews) work against real data without touching production — and the branch is torn down when the run’s sandbox is cleaned up.
Connect Neon
Add a Neon API key
In integration settings, paste a Neon API key (it starts with napi_).
For security, prefer a project-scoped key (Neon console → Organization
settings → API keys); account-wide keys work too but grant access to all
projects. For a project-scoped key, also enter its Project ID.
Choose the project and branch
Once connected, pick the project runs should branch from and, optionally, a parent branch (each run branches from it; leave empty to use the project’s default). Save the configuration.
Use it in a repository
Tell a repository to use Neon by declaring the resource in its
.trevize/settings.json, mapping your app’s database
environment variable to the one Trevize provides:
{
"resources": {
"neon": {
"env": {
"DATABASE_URL": "NEON_DATABASE_URL"
}
}
}
}For each run, Trevize provisions a branch and injects NEON_DATABASE_URL (the
branch’s connection string) and NEON_BRANCH_ID into the sandbox. The mapping
above sets your app’s DATABASE_URL from NEON_DATABASE_URL. The settings page
shows, per repository, whether the resource is configured and the env mapping
in effect.