Read-only database tasks

Use native drivers, bound parameters and bounded result sets.

SecretBridge 0.3.1Updated 2026-10-12
On this page

Workflow

PostgreSQL and MySQL resources support connection checks, version queries and registered read-only query templates. Use a dedicated read-only account and TLS, and bound output columns, row count and timeout. The password is used only for native driver authentication, never in SQL or the connection URL.

Boundary and checks

Use typed parameter binding for ordinary SQL values; identifiers and SQL fragments cannot be parameters. Before approval, inspect the target database, complete query, values and output columns. Verify the business result and truncation flag afterward.

Supported operations

Native PostgreSQL and MySQL connectors offer connection checks, version reads and user-registered read-only query templates. They do not accept free-form SQL or require a psql or mysql CLI. Use a dedicated read-only account, fixed database and port, and full TLS verification. The password is used for driver authentication, never placed in SQL, a connection URL or chat. The documented test range is PostgreSQL 14–17 and MySQL 8.0/8.4; MariaDB is not claimed as supported.

Configure a query

  1. Save the address, account, database and authentication in a resource, then run its fixed read-only connection check.
  2. Create a database task for a connection or version check, or register a SELECT/WITH query. Ordinary values use unquoted {{param:name}} placeholders bound by the driver. Table names, column names, ordering and SQL fragments cannot be parameters.
  3. Select 1–32 output columns, a limit of 1–1000 rows and optionally a minimum expected row count. Review full SQL, resolved parameters, target and result scope before approving.
  4. After execution, inspect technical state together with validation_status, truncated and cleanup_ok. Cells are returned as text or NULL to preserve long integers and high-precision decimals.

Queries run in read-only transactions. verify_full validates certificates and hostnames by default; a private CA can be configured as the product guide describes. Explicitly disabled TLS sends data in cleartext and is never an automatic fallback. Column selection and known-secret filtering do not make all business data safe to send to an AI.

Interpreting failures

Row or output-budget limits mark the result truncated; a result below the expected minimum needs business-level review. Timeout and cancellation attempt to stop the database session, but cleanup_ok:false requires checking the remote side. Do not assume every remote action rolled back. The linked product source document provides detailed SQL and parameter limits.

Corresponding product documentation · Report a documentation issue