Repository navigation
Replies: 1 comment
|
The tool names ( Why Fix 1: start the server in restricted mode. Wherever your connector starts the server, change the argument: In restricted mode every tool, including
Plain Fix 2: connect with a role that can't write. Restricted mode is the server's own check. The database should still refuse writes even if a check is missed: create role octop_inspector login password '...';
alter role octop_inspector set default_transaction_read_only = on;
grant pg_read_all_data to octop_inspector; -- PG 14+; or GRANT SELECT per schema/table
grant pg_read_all_stats to octop_inspector; -- for pg_stat_statements-based toolsMake sure it doesn't own any objects and has no With both in place, you can leave On your last question: I didn't find a per-argument policy for MCP tools in Octop's |
Uh oh!
There was an error while loading. Please reload this page.
I am trying to configure an Octop agent for read-only PostgreSQL inspection. It should be able to inspect schemas and analyze query plans, but it should not be able to execute arbitrary SQL, create database objects, or insert data.
I used
HarnessAgentConfig.tools_disabledto remove the general execution paths. The relevant configuration was equivalent to:The model-visible tool list contained
postgres_explain_query,postgres_analyze_query_indexes,postgres_get_object_details,postgres_list_objects, andpostgres_list_schemas. It did not containpostgres_execute_sqlor the genericexecutetool. The general SQL and shell-style execution paths were therefore explicitly placed intools_disabled, while query-plan inspection remained available.The intended read-only boundary was bypassed through the allowed
postgres_explain_querytool. A multi-statement input beginning withSELECT 1;was followed byCREATE TABLEorCREATE INDEX; the tool returnedError: No results returned from EXPLAIN, but the DDL had already taken effect. With analysis enabled, anINSERT ... SELECTwas also executed as part ofEXPLAIN ANALYZE. This route created a report table, created several indexes, and populated the table with 50 rows. The agent did this without calling either disabled execution tool.How should I correctly configure this use case in Octop? Can
tools_disabledbe combined with argument or effect constraints that forceexplain_queryto be single-statement and read-onlyAll reactions