Authenticate every request with a secret API key:
Authorization: Bearer flowyte_sk_…. The kind
is postgres or mysql.How it fits together
1
Create a least-privilege database user
Generate the SQL to create a scoped user, then run it on your database — the agent never uses
your admin credentials.
2
Test, then connect
Validate the credentials, then connect with them. They’re encrypted at rest and never echoed back.
3
Discover the schema and scope it
Introspect the database, then optionally block tables/columns the agent must never see.
4
Bind queries as skills
Map a read (or a scoped write) onto a skill — a frozen, parameterized statement the agent calls.
1. Generate a scoped database user
GET /integrations/{kind}/sql/scripts returns copy-paste SQL to create a least-privilege
database user: a read-only role (SELECT only) and, if you need writes, a script scoped to only
the tables your write skills touch — never blanket write. If you don’t pass a password, a strong one
is generated and returned once.
2. Test the connection
POST /integrations/{kind}/sql/test runs an ordered set of checks — reachability and TLS,
authentication, reading the schema, a timed read probe, a read-only-session proof, and a live-call
latency verdict — without storing anything. It always returns 200 with the check results and
an overall ok flag; a host that resolves to a private, loopback, or metadata address is refused.
3. Connect
Pass the same credentials to the generic connect endpoint. Thekind is postgres or mysql.
4. Discover the schema and scope it
Introspect the database into a normalized schema, then read it (or search it) to find what to map:5. Bind a query as a skill
Map an operation onto a skill with a binding: a read filters on one indexed column; a write is a single-row insert or an update-by-unique-key. The binding compiles to a frozen, parameterized statement — the agent supplies the parameters and never sees raw SQL or the full schema. Writes land disabled for review, and columns you scoped out are rejected.POST /agents/{id}/integrations/postgres/bindings/auto takes a
plain-language goal and the AI assistant proposes the binding for you to review.
In the API
Full walkthrough: Connect a SQL database.