diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 516be6ec..7fedb10a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -574,7 +574,6 @@ jobs: VERSION=${{ github.sha }} SHORT_VERSION=$(echo ${{ github.sha }} | cut -c 1-6) docker buildx build \ - --target run \ --push \ --build-arg="VERSION=$VERSION" \ --build-arg="SHORT_VERSION=$SHORT_VERSION" \ diff --git a/data-connector/README.md b/data-connector/README.md index 191abe43..24db3ef5 100644 --- a/data-connector/README.md +++ b/data-connector/README.md @@ -9,7 +9,7 @@ Inferable Data Connector is a bridge between your data systems and Inferable. Co - 🧩 **Extensible**: Adding a new data source is as simple as writing a new connector. See the [Postgres](./src/postgres.ts) connector for an example. - 🔄 **Adapts to schema changes**: The connector automatically adapts to schema changes by periodically fetching the data system schema. (Table definitions, API definitions, etc.) - 🤿 **Optional Privacy Mode**: Query outputs are never sent to the model. Instead, the function returns results directly to the end user without any model involvement. -- 🔍 **Optional Paranoid Mode**: Adds an additional safety layer by requiring manual approval before executing any query so you can review the query and data before it is executed. +- 🔍 **Optional Approval Mode**: Adds an additional safety layer by requiring manual approval before executing any query so you can review the query and data before it is executed. ## Connectors @@ -81,7 +81,7 @@ Example configuration: ```json { "privacyMode": 0, - "paranoidMode": 0, + "approvalMode": 0, "connectors": [ { "type": "postgres", @@ -125,7 +125,7 @@ configs: content: | { "privacyMode": 0, - "paranoidMode": 0, + "approvalMode": 0, "connectors": [ { "type": "postgres", @@ -144,7 +144,7 @@ Each connector is defined in the `config.connectors` array. - `config.connectors[].type`: The type of connector. Currently only `postgres` is supported. - `config.connectors[].name`: The name of the connector. This is the Inferable service name. One will be generated if not provided. - `config.connectors[].privacyMode`: The privacy mode. Set to `1` to enable `privacyMode` (Overrides the value at `config.privacyMode`) -- `config.connectors[].paranoidMode`: The paranoid mode. Set to `1` to enable `paranoidMode` (Overrides the value at `config.paranoidMode`) +- `config.connectors[].approvalMode`: The approval mode. Set to `1` to enable `approvalMode` (Overrides the value at `config.approvalMode`)
Postgres Connector Configuration @@ -200,11 +200,11 @@ Note: This may limit some advanced reasoning capabilities that require direct da ![Privacy Mode](./assets/privacy.png) -### config.paranoidMode +### config.approvalMode -Adds an additional safety layer by requiring manual approval before executing any queries. Enable with `config.paranoidMode=1`. This can get annoying really quickly, so we've disabled it by default. +Adds an additional safety layer by requiring manual approval before executing any queries. Enable with `config.approvalMode=1`. This can get annoying really quickly, so we've disabled it by default. -![Paranoid Mode](./assets/paranoid.gif) +![Approval Mode](./assets/paranoid.gif) ## Production Deployment @@ -219,7 +219,7 @@ When deploying to production, follow these security best practices: 3. **Query Approval**: -- Set `config.paranoidMode=1` to require manual approval of queries. +- Set `config.approvalMode=1` to require manual approval of queries. - This provides an additional layer of control over database interactions ## Architecture diff --git a/data-connector/config.json b/data-connector/config.json index c765c590..d0887369 100644 --- a/data-connector/config.json +++ b/data-connector/config.json @@ -1,6 +1,6 @@ { "privacyMode": 0, - "paranoidMode": 0, + "approvalMode": 0, "maxResultLength": 20000, "connectors": [ { diff --git a/data-connector/src/graphql/README.md b/data-connector/src/graphql/README.md index fd197f2f..a147544e 100644 --- a/data-connector/src/graphql/README.md +++ b/data-connector/src/graphql/README.md @@ -44,7 +44,7 @@ sequenceDiagram %% Query Execution LLM->>Connector: Execute operation - alt Paranoid Mode + alt Approval Mode Connector->>Human: Request approval Human-->>Connector: Approve request end @@ -63,7 +63,7 @@ sequenceDiagram - **Schema Introspection**: Provides detailed type information for constructing queries - **Automatic Function Generation**: Creates Inferable functions from GraphQL operations - **Privacy Mode**: Prevents sensitive API responses from passing through the LLM -- **Paranoid Mode**: Requires human approval for API requests +- **Approval Mode**: Requires human approval for API requests - **Type Validation**: Ensures queries match the GraphQL schema ## Important Considerations @@ -121,7 +121,7 @@ query user($id: ID!) { - **Authentication**: Configure through defaultHeaders - **Privacy Mode**: Prevents sensitive API responses from reaching the LLM -- **Paranoid Mode**: Requires approval before making requests +- **Approval Mode**: Requires approval before making requests - **Schema Validation**: Ensures queries match the GraphQL schema ### GraphQL-Specific Features diff --git a/data-connector/src/graphql/graphql.ts b/data-connector/src/graphql/graphql.ts index ebedcfe1..400842ec 100644 --- a/data-connector/src/graphql/graphql.ts +++ b/data-connector/src/graphql/graphql.ts @@ -28,7 +28,7 @@ export class GraphQLClient implements DataConnector { maxResultLength: number; defaultHeaders?: Record; privacyMode: boolean; - paranoidMode: boolean; + approvalMode: boolean; }, ) {} @@ -139,7 +139,7 @@ To understand the input and output types for this operation, use the searchGraph }, ctx: ContextInput, ) => { - if (this.params.paranoidMode) { + if (this.params.approvalMode) { if (!ctx.approved) { console.log("Request requires approval"); return approvalRequest(); diff --git a/data-connector/src/index.ts b/data-connector/src/index.ts index 4dc54edc..427fc9b2 100644 --- a/data-connector/src/index.ts +++ b/data-connector/src/index.ts @@ -57,7 +57,7 @@ const parseConfig = (connector: any) => { if (connector.type === "postgres") { const postgresClient = new PostgresClient({ - paranoidMode: config.paranoidMode === 1, + approvalMode: config.approvalMode === 1, privacyMode: config.privacyMode === 1, maxResultLength: Number(config.maxResultLength), ...connector, @@ -67,7 +67,7 @@ const parseConfig = (connector: any) => { services.push(service); } else if (connector.type === "open-api") { const openAPIClient = new OpenAPIClient({ - paranoidMode: config.paranoidMode === 1, + approvalMode: config.approvalMode === 1, privacyMode: config.privacyMode === 1, maxResultLength: Number(config.maxResultLength), ...connector, @@ -77,7 +77,7 @@ const parseConfig = (connector: any) => { services.push(service); } else if (connector.type === "graphql") { const graphQLClient = new GraphQLClient({ - paranoidMode: config.paranoidMode === 1, + approvalMode: config.approvalMode === 1, privacyMode: config.privacyMode === 1, maxResultLength: Number(config.maxResultLength), ...connector, @@ -87,7 +87,7 @@ const parseConfig = (connector: any) => { services.push(service); } else if (connector.type === "mysql") { const mysqlClient = new MySQLClient({ - paranoidMode: config.paranoidMode === 1, + approvalMode: config.approvalMode === 1, privacyMode: config.privacyMode === 1, maxResultLength: Number(config.maxResultLength), ...connector, @@ -97,7 +97,7 @@ const parseConfig = (connector: any) => { services.push(service); } else if (connector.type === "sqlite") { const sqliteClient = new SQLiteClient({ - paranoidMode: config.paranoidMode === 1, + approvalMode: config.approvalMode === 1, privacyMode: config.privacyMode === 1, maxResultLength: Number(config.maxResultLength), ...connector, diff --git a/data-connector/src/mysql/README.md b/data-connector/src/mysql/README.md index 9d818094..a23448d9 100644 --- a/data-connector/src/mysql/README.md +++ b/data-connector/src/mysql/README.md @@ -36,7 +36,7 @@ sequenceDiagram %% Query Execution LLM->>Connector: executeMysqlQuery() - alt Paranoid Mode + alt Approval Mode Connector->>Human: Request approval Human-->>Connector: Approve query end @@ -54,7 +54,7 @@ sequenceDiagram - **Schema Analysis**: Automatically maps database structure for LLM context - **Privacy Mode**: Prevents sensitive data from passing through the LLM -- **Paranoid Mode**: Requires human approval for query execution +- **Approval Mode**: Requires human approval for query execution - **Sample Data**: Provides example rows to help LLM understand data patterns ## Important Considerations diff --git a/data-connector/src/mysql/mysql.ts b/data-connector/src/mysql/mysql.ts index e8309f5c..42128199 100644 --- a/data-connector/src/mysql/mysql.ts +++ b/data-connector/src/mysql/mysql.ts @@ -16,7 +16,7 @@ export class MySQLClient implements DataConnector { connectionString: string; maxResultLength: number; privacyMode: boolean; - paranoidMode: boolean; + approvalMode: boolean; }, ) { assert(params.schema, "Schema parameter is required"); @@ -107,7 +107,7 @@ export class MySQLClient implements DataConnector { }; executeMysqlQuery = async (input: { query: string }, ctx: ContextInput) => { - if (this.params.paranoidMode) { + if (this.params.approvalMode) { if (!ctx.approved) { console.log("Query requires approval"); return approvalRequest(); diff --git a/data-connector/src/open-api/README.md b/data-connector/src/open-api/README.md index 3de31bde..a521ca0e 100644 --- a/data-connector/src/open-api/README.md +++ b/data-connector/src/open-api/README.md @@ -39,7 +39,7 @@ sequenceDiagram %% Request Execution LLM->>Connector: Execute operation - alt Paranoid Mode + alt Approval Mode Connector->>Human: Request approval Human-->>Connector: Approve request end @@ -57,7 +57,7 @@ sequenceDiagram - **Automatic Function Generation**: Creates Inferable functions from OpenAPI operations - **Privacy Mode**: Prevents sensitive API responses from passing through the LLM -- **Paranoid Mode**: Requires human approval for API requests +- **Approval Mode**: Requires human approval for API requests - **Parameter Validation**: Ensures requests match the OpenAPI specification - **Default Headers**: Supports global headers for authentication - **OperationId Filtering**: Explicitly allow certain OpenAPI operations @@ -93,7 +93,7 @@ By default, the connector will attach **all** operations in the OpenAPI spec to - **Authentication**: Configure through defaultHeaders - **Privacy Mode**: Prevents sensitive API responses from reaching the LLM -- **Paranoid Mode**: Requires approval before making requests +- **Approval Mode**: Requires approval before making requests - **URL Validation**: Ensures requests match the OpenAPI spec paths ### OpenAPI-Specific Features diff --git a/data-connector/src/open-api/open-api.ts b/data-connector/src/open-api/open-api.ts index 1547985b..22194c42 100644 --- a/data-connector/src/open-api/open-api.ts +++ b/data-connector/src/open-api/open-api.ts @@ -23,7 +23,7 @@ export class OpenAPIClient implements DataConnector { maxResultLength: number; defaultHeaders?: Record; privacyMode: boolean; - paranoidMode: boolean; + approvalMode: boolean; }, ) {} @@ -183,7 +183,7 @@ export class OpenAPIClient implements DataConnector { }, ctx: ContextInput, ) => { - if (this.params.paranoidMode) { + if (this.params.approvalMode) { if (!ctx.approved) { console.log("Request requires approval"); return approvalRequest(); diff --git a/data-connector/src/postgres/README.md b/data-connector/src/postgres/README.md index cbcd4c8b..3dfd5b92 100644 --- a/data-connector/src/postgres/README.md +++ b/data-connector/src/postgres/README.md @@ -36,7 +36,7 @@ sequenceDiagram %% Query Execution LLM->>Connector: executePostgresQuery() - alt Paranoid Mode + alt Approval Mode Connector->>Human: Request approval Human-->>Connector: Approve query end @@ -54,7 +54,7 @@ sequenceDiagram - **Schema Analysis**: Automatically maps database structure for LLM context - **Privacy Mode**: Prevents sensitive data from passing through the LLM -- **Paranoid Mode**: Requires human approval for query execution +- **Approval Mode**: Requires human approval for query execution - **Sample Data**: Provides example rows to help LLM understand data patterns ## Important Considerations diff --git a/data-connector/src/postgres/postgres.ts b/data-connector/src/postgres/postgres.ts index a21cd6e9..077eaaab 100644 --- a/data-connector/src/postgres/postgres.ts +++ b/data-connector/src/postgres/postgres.ts @@ -16,7 +16,7 @@ export class PostgresClient implements DataConnector { connectionString: string; maxResultLength: number; privacyMode: boolean; - paranoidMode: boolean; + approvalMode: boolean; }, ) { assert(params.schema, "Schema parameter is required"); @@ -114,7 +114,7 @@ export class PostgresClient implements DataConnector { input: { query: string }, ctx: ContextInput, ) => { - if (this.params.paranoidMode) { + if (this.params.approvalMode) { if (!ctx.approved) { console.log("Query requires approval"); return approvalRequest(); diff --git a/data-connector/src/sqlite/README.md b/data-connector/src/sqlite/README.md index bc013d21..c34b75b6 100644 --- a/data-connector/src/sqlite/README.md +++ b/data-connector/src/sqlite/README.md @@ -35,7 +35,7 @@ sequenceDiagram %% Query Execution LLM->>Connector: executeSqliteQuery() - alt Paranoid Mode + alt Approval Mode Connector->>Human: Request approval Human-->>Connector: Approve query end @@ -53,7 +53,7 @@ sequenceDiagram - **Schema Analysis**: Automatically maps database structure for LLM context - **Privacy Mode**: Prevents sensitive data from passing through the LLM -- **Paranoid Mode**: Requires human approval for query execution +- **Approval Mode**: Requires human approval for query execution - **Sample Data**: Provides example rows to help LLM understand data patterns - **File-Based**: Works with local SQLite database files diff --git a/data-connector/src/sqlite/sqlite.ts b/data-connector/src/sqlite/sqlite.ts index 11366179..e81fd6f3 100644 --- a/data-connector/src/sqlite/sqlite.ts +++ b/data-connector/src/sqlite/sqlite.ts @@ -16,7 +16,7 @@ export class SQLiteClient implements DataConnector { filePath: string; maxResultLength: number; privacyMode: boolean; - paranoidMode: boolean; + approvalMode: boolean; }, ) { assert(params.filePath, "File path parameter is required"); @@ -105,7 +105,7 @@ export class SQLiteClient implements DataConnector { }; executeSqliteQuery = async (input: { query: string }, ctx: ContextInput) => { - if (this.params.paranoidMode) { + if (this.params.approvalMode) { if (!ctx.approved) { console.log("Query requires approval"); return approvalRequest();