Skip to main content
Each World instance gets its own writable Postgres database, initialized from the saved rows. Hue hosts it; you don’t need to run Postgres locally.

Describe your tables

Select Postgres when you generate a World, or include postgres in create_world over MCP. Describe the tables, columns, types, defaults, relationships, and starting rows you need. Hue fills in details you leave open. For example:
Prompt
To add Postgres to a World you already have, send the same table description and the World link to your coding agent. Ask it to use edit_world and keep the other apps unchanged. Check Postgres → Starting rows on the new version. This preview does not start a database. Use up to 12 tables with 24 columns each and up to 20,000 starting rows or 10 MiB, whichever you reach first. Hue supports text, integer, bigint, numeric, boolean, date, timestamptz, UUID, and JSONB. Use a single-column primary key per table and foreign keys to primary keys. Defaults can be literals, the current timestamp, or a generated UUID. Hue runs PostgreSQL 17 without extensions. Describe the schema rather than supplying SQL or a dump.

Connect your agent

  1. Open a World with Postgres and choose Start instance.
  2. Select Postgres → Connect → Copy URL. If it’s still preparing, choose Prepare to check again.
  3. Pass that URL to your agent’s Postgres client as a secret for this run. Don’t put it in prompts or logs.
Set up TLS once per environment. Download the server CA bundle and set PGSSLROOTCERT to its path. Keep hostname and certificate verification on. Only the URL changes each run. To read and update the warehouse fixture, install pg or psycopg[binary]. Set WORLD_DATABASE_URL for this process only, or pass the URL directly to the client. Don’t change the parent process environment for concurrent instances.
Stop the instance when you finish. At stop or expiry, Hue removes the database. Start a fresh instance and use its URL to see 12 11 again. The saved seed stays unchanged.

Connect a harness through the API

Send requests to https://app.hue.run with Content-Type: application/json and Authorization: Bearer <project key>. Use the same server-side Read and write key for start, reveal, and finish. To select a project other than the key’s default, send the same X-Hue-Project: <project-id> on every request.
  1. POST /api/v1/environment-runs with X-Hue-Native-Connections: 1 and {"environmentVersionId":"<world-version-id>","idempotencyKey":"<start-key>"}. Use the version ID, not the World ID. Reuse the key if retrying the same start.
  2. From the start response, take id and find the entry in nativeApps with providerId equal to postgres. Send that entry’s appKey in the JSON body of POST /api/v1/environment-runs/{id}/native-connection. Poll while state is preparing. When it’s ready, pass url to that run’s client. If setup fails, finish the instance rather than connecting to a fallback database. MCP can start a World but does not reveal its SQL credentials.
  3. Collect any SQL evidence, then POST /api/v1/environment-runs/{id}/finish in a finally block. Send {"status":"completed","idempotencyKey":"<finish-key>"} on success, or "status":"abandoned" if setup or the run fails or you cancel it.
Each instance allows four harness connections. Live rows is available only for standalone instances.