- named in
bridge.yaml - selected with
--from <name> - responsible for connecting, listing, reading, and reporting health
filesystempostgres
How providers fit into Bridge
At runtime, Bridge:- loads
bridge.yaml - resolves the provider by name
- connects using that provider’s URI
- calls
list,read, orhealth - returns structured JSON
Capability model
The provider interface includes support for these capabilities:readlistwritedeletesearch
| Provider | Read | List | Write | Delete | Search |
|---|---|---|---|---|---|
| Filesystem | yes | yes | no | no | no |
| Postgres | yes | yes | no | no | no |
Filesystem provider
Use the filesystem provider when you want Bridge to expose files and directories from a local project, docs folder, dataset, or generated output directory.URI format
- relative paths like
file://./docs - absolute paths like
file:///Users/alice/project/docs
What ls returns
bridge ls --from files lists the top-level contents of the configured root directory.
Entries are returned as:
filedirectory
- listing is not recursive
- entries are sorted by name
- file entries may include
sizeandupdated_at - directory entries do not include file size
What read returns
bridge read <path> --from files reads a file relative to the provider root.
Examples:
| File kind | Returned data.type | Notes |
|---|---|---|
| UTF-8 text files | text | Includes Markdown, plain text, YAML, TOML, CSV, HTML, and similar text formats |
| Valid JSON files | json | Parsed into JSON before returning |
| Non-text or non-UTF-8 files | binary | Returned as base64-encoded content |
Security behavior
The filesystem provider enforces a root boundary. Once connected to a directory, Bridge:- canonicalizes the provider root
- canonicalizes requested paths
- rejects reads that escape the root directory
../../etc/passwd is blocked instead of being resolved outside the configured provider.
Common filesystem errors
Directory does not exist
Directory does not exist
If the configured
file:// URI points to a directory that does not exist, bridge connect can still write the config, but provider operations such as ls and read will fail when Bridge tries to connect.Path is not a directory
Path is not a directory
A filesystem provider must point to a directory, not to a single file.
Path not found
Path not found
If you try to read a file that does not exist under the configured root, Bridge returns a provider error.
Path traversal denied
Path traversal denied
If a requested path escapes the configured root, Bridge returns a path traversal error.
Postgres provider
Use the Postgres provider when you want agents to list tables and read rows from a PostgreSQL database through the same Bridge command surface.URI format
postgres://...postgresql://...
What ls returns
bridge ls --from db returns tables from the public schema.
Example:
- only the
publicschema is listed - entries are returned as
table - table metadata does not currently include size or timestamps
What read returns
The Postgres provider supports two path shapes.
Read a whole table
Read a single row by primary key
Important Postgres limitations today
The current implementation is intentionally conservative.- Reads only work against tables in the
publicschema - Table names must match
[a-zA-Z_][a-zA-Z0-9_]* - Whole-table reads require a single-column primary key
- Row reads also require a single-column primary key
- Tables without a primary key are listed by
lsbut cannot be read withbridge read - Tables with composite primary keys are listed by
lsbut cannot be read withbridge read - Whole-table reads honor
read --limit, and fall back to100rows when no explicit limit is provided
Type handling
Postgres rows are returned as JSON. Bridge currently handles common types such as:- integers
- floats and numeric values
- booleans
jsonandjsonb
null.
Metadata behavior
For Postgres reads, the metadatasource is not just "postgres". Bridge stores a redacted version of the connection URI so the response can identify the backend without leaking passwords.
Security behavior
The Postgres provider is designed to keep table and row reads safe:- identifiers are validated before being used in SQL
- identifiers are quoted when queries are built
- row values are passed as bound parameters
- connection URIs are redacted in user-facing metadata and status messages
Common Postgres errors
Table not found
Table not found
If the requested table does not exist in the
public schema, Bridge returns a provider error and suggests using bridge ls --from <provider> to see available tables.Row not found
Row not found
If the table exists but the requested primary key value does not, Bridge returns a provider error for that row path.
No primary key
No primary key
If a table has no primary key, Bridge cannot safely support
bridge read <table> or bridge read <table>/<id> for that table in the current implementation.Composite primary key
Composite primary key
If a table uses a composite primary key, Bridge currently refuses the read rather than guessing how the row path should be encoded.
Invalid identifier
Invalid identifier
Bridge rejects suspicious table names before they reach SQL. This blocks obvious injection attempts and keeps table paths constrained to simple identifiers.
Health checks
Both providers supportbridge status.
- The filesystem provider reports whether the configured directory exists
- The Postgres provider runs a lightweight
SELECT 1health query and includes latency
Planned providers
Bridge’s long-term direction is broader than the two providers available today. The current CLI roadmap calls out:- SQLite
- S3
- vector store providers such as Qdrant and Pinecone
Next steps
Configuration
See how provider definitions live inside
bridge.yaml.CLI interface
See how provider reads and lists become structured JSON output.