Agents need a database they can actually use
AI coding agents are good at changing schemas, writing queries and running test suites. They still need an isolated PostgreSQL environment to verify that work. A shared development database creates collisions, stale data and cleanup work.
Aiadio creates a real temporary PostgreSQL database through an API. The agent receives a standard connection URL, uses normal Postgres tools, and the database is removed when its time-to-live expires.
Give each task its own database and choose the shortest TTL that covers the run. This keeps agent work isolated and limits forgotten environments.
One database per task
- Create a temporary database before the agent starts its database work.
- Pass the returned PostgreSQL URL to the agent as a protected secret.
- Let the agent run migrations, seed data and integration tests with standard tools.
- Read the result and keep or discard the application changes independently.
- Let TTL cleanup remove the database and its role automatically.
This works for coding agents, CI jobs, preview environments and short-lived prototypes. It does not replace a durable production database.
Create temporary Postgres by API
Use an Aiadio API key in the X-API-Key header. Keep the key and the returned connection URL server-side or in your agent runtime's secret store.
curl -X POST https://api.aiadio.com/v1/databases \
-H "X-API-Key: dbn_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "agent-task-42",
"expires_in": "3h",
"allowed_cidr": "203.0.113.10/32"
}'
{
"id": "db_8f4c2",
"status": "ready",
"postgres_url": "postgresql://...",
"expires_at": "2026-09-16T15:00:00.000Z"
}
Use postgres_url with PostgreSQL clients, ORMs, migration tools and test runners. The API is documented in full on the Aiadio API docs.
Keep agent access narrow
- Use a separate Aiadio API key for the workload and keep it out of prompts and source control.
- Restrict network access with the smallest practical
allowed_cidr. - Never expose a returned PostgreSQL URL in browser JavaScript or public logs.
- Use short TTL values for experiments and test runs; use a durable database for data that must persist.
Postgres for AI agents: common questions
Is this a mock database?
No. Aiadio provides a real PostgreSQL database that works with standard PostgreSQL clients and tooling.
Can an agent run migrations and tests?
Yes. Give the agent the returned PostgreSQL URL through a protected runtime secret and point your migration or test command at it.
How long does the database live?
The documented TTL range is 1 hour to 30 days. When the TTL expires, Aiadio removes the temporary database and role automatically.
Where can I see the exact request fields?
See the API documentation for authentication, create, status and error responses.
Build the agent workflow around an isolated, disposable Postgres database.
Get started