PostgreSQL + Kroy

Connect PostgreSQL once. Use it safely with any AI.

  1. PostgreSQL, where it already is.

    PostgreSQL stays the authoritative record. Nothing moves, and nothing is copied that doesn’t need to be.

  2. PostgreSQL connects to Kroy.

    Database credentials for a dedicated, least-privilege PostgreSQL role, held by Kroy. Kroy holds the connection.

  3. Your AI connects to Kroy.

    Claude, ChatGPT or another AI connects to Kroy — not to PostgreSQL. It never receives PostgreSQL credentials.

  4. Exactly what is allowed.

    Each PostgreSQL action is a Kroy capability; run named write statement waits for a person by default. Kroy does not run schema changes (DDL) or grant database privileges.

  5. A real request.

    Claude asks for read exposed schema. Kroy checks the person, the agent and the policy, calls PostgreSQL, and records the request.

PostgreSQL
Kroy
Claude
Priya Client manager
AUDIT

PostgreSQL capabilities

  • postgresql.schema.read
  • postgresql.query.read
  • postgresql.query.adhoc_read
  • !postgresql.statement.execute
  • Kroy does not run schema changes (DDL…
PostgreSQL
Kroy
Claude
Priya Client manager
AUDIT

PostgreSQL capabilities

  • postgresql.schema.read
  • postgresql.query.read
  • postgresql.query.adhoc_read
  • !postgresql.statement.execute
  • Kroy does not run schema changes (DDL…
PostgreSQL connecting to Kroy, then to an authorised AI. PostgreSQL, where it already is.. PostgreSQL connects to Kroy.. Your AI connects to Kroy.. Exactly what is allowed.. A real request..

Supported resources

  • Schemas, tables and views you choose to expose
  • Named queries defined by your team
  • Named statements for approved writes

Authentication

Database credentials for a dedicated, least-privilege PostgreSQL role, held by Kroy. AI clients never receive the connection string or password.

Supported actions

CapabilityTypeDefault
postgresql.schema.read
Read exposed schema
readPolicy
postgresql.query.read
Run named read query
readPolicy
postgresql.query.adhoc_read
Run ad hoc read-only query
readHuman approval
postgresql.statement.execute
Run named write statement
writeHuman approval

Events

postgresql.statement.executed

Overview

A great deal of useful information lives in databases that no off-the-shelf AI tool can reach: the ERP, the order system, the internal platform. The usual shortcut — giving an AI a connection string — gives it far more than any single question needs.

Kroy connects to PostgreSQL with a dedicated role. Your team decides which tables, views and queries are exposed. Authorised AI asks Kroy, and Kroy runs only what policy allows.

Named queries first

The safest default is a set of named, parameterised queries written and reviewed by your team — open_orders_by_customer, stock_below_reorder_level. The AI chooses a query and supplies parameters; it does not write SQL against production. Ad hoc read-only queries can be enabled for particular people and agents, and require approval by default.

Permissions

Each query and statement is a Kroy capability. Kroy decides every request against the person, the agent, the delegation between them and the organisation’s policies. Kroy can also apply row-level rules — for example, a regional manager’s AI sees that region’s orders only.

Writes are named statements, such as marking an order as reviewed, and require approval by default.

Industries

Technology companies and firms with in-house systems can give AI useful access to operational data. In financial services, where data handling is closely supervised, named queries and a complete audit trail make it easier to explain exactly what AI could reach.

Security

Kroy holds the database credentials. AI clients never receive them. Every query is recorded with the person, the agent, the query name, the parameters and the number of rows returned, so a reviewer can see precisely what left the database.

Limitations

  • Kroy does not run schema changes (DDL) or grant database privileges.
  • Writes happen only through named statements your team has defined, and require approval by default.
  • Databases on private networks need a network path Kroy can reach; the options are described in the docs.
  • Kroy cannot see more than the PostgreSQL role it holds is allowed to. Use a dedicated role with the smallest grants that work.
  • Large result sets are truncated; the AI is told when that happens.