pgbeam 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -180,6 +180,33 @@
180
180
  "responseType": "{ connection_string: string; credential: { auth_method?: \"cleartext\" | \"scram-sha-256\"; created_at: string; expires_at?: string; id: string; last_used_at?: string; name: string; pg_username: string; policy_profile_id: string; principal_type?: \"agent\" | \"human\"; project_id: string; status: \"active\" | \"disabled\" | \"revoked\"; updated_at: string }; mcp_token: string; mcp_url: string }",
181
181
  "responseStatus": "200"
182
182
  },
183
+ "recommendAgentPolicy": {
184
+ "operationId": "recommendAgentPolicy",
185
+ "method": "POST",
186
+ "path": "/v1/projects/{project_id}/agents/{agent_id}/policy-recommendation",
187
+ "summary": "Recommend a least-privilege policy from recorded traffic",
188
+ "description": "Derives the tightest policy that would still pass every statement this agent credential has legitimately run, using its recorded audit history over a lookback window (default 30 days). The candidate's table allowlist is the union of relations actually referenced, its statement-kind allow set is the observed set, it downgrades to read-only when no writes were seen, and its max_rows ceiling comes from an observed high-percentile row count. The candidate is proven safe by replaying it through the data plane's own policy engine against the same history: a good recommendation has replay.summary.newly_blocked == 0. This endpoint is advisory only. It reads the audit log, never connects to the upstream database, and never creates, updates, or mutates any policy or credential; the operator loads the candidate into the editor and saves it themselves.",
189
+ "parameters": [
190
+ {
191
+ "name": "project_id",
192
+ "in": "path",
193
+ "required": true,
194
+ "type": "string",
195
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
196
+ },
197
+ {
198
+ "name": "agent_id",
199
+ "in": "path",
200
+ "required": true,
201
+ "type": "string",
202
+ "description": "Unique agent credential identifier (prefixed, e.g. agt_xxx)."
203
+ }
204
+ ],
205
+ "requestBodyType": "{ limit?: number; lookback_days?: number }",
206
+ "requestBodyRequired": false,
207
+ "responseType": "{ candidate?: { access_mode?: \"read_only\" | \"read_write\"; approval_auto_max_rows?: number; approval_mode?: \"off\" | \"writes\" | \"ddl\" | \"all\"; approval_timeout_seconds?: number; budget_queries_per_day?: number; budget_queries_per_hour?: number; egress_bytes_per_day?: number; masking_rules?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\"; table: string })[]; max_affected_rows?: number; max_rows?: number; migration_safety?: \"off\" | \"warn\" | \"block\"; name: string; row_filters?: ({ predicate: string; table: string })[]; statement_rules?: { allow?: string[]; deny?: string[] }; statement_timeout_ms?: number; table_allowlist?: string[]; table_denylist?: string[]; write_mode?: \"normal\" | \"rollback\" | \"sandbox\" }; message?: string; notes?: string[]; observed_entries: number; observed_queries: number; replay?: { items: ({ change: \"newly_blocked\" | \"newly_allowed\" | \"still_allowed\" | \"still_blocked\"; first_seen: string; last_seen: string; occurrences: number; query_hash: string; recorded_event: string; recorded_rule?: string; result: { hint?: string; masked_columns?: ({ column: string; kind: \"redact\" | \"null\" | \"hash\" })[]; notes?: string[]; reason: string; rewritten_sql?: string; row_filter_predicate?: string; rule: string; verdict: \"allow\" | \"block\" | \"mask\" | \"row-filter\" }; sql: string; statement_kind?: string })[]; summary: { distinct_queries: number; entries_scanned: number; evaluated: number; newly_allowed: number; newly_blocked: number; skipped_unparseable: number; truncated: boolean; would_allow: number; would_block: number; would_mask: number; would_row_filter: number } }; sufficient_history: boolean; window_end: string; window_start: string }",
208
+ "responseStatus": "200"
209
+ },
183
210
  "listAnomalyAlerts": {
184
211
  "operationId": "listAnomalyAlerts",
185
212
  "method": "GET",
@@ -1086,6 +1113,141 @@
1086
1113
  "responseType": "{ image_sha: string; status: \"ok\" | \"degraded\"; timestamp?: string; version: string }",
1087
1114
  "responseStatus": "200"
1088
1115
  },
1116
+ "listHoneytokens": {
1117
+ "operationId": "listHoneytokens",
1118
+ "method": "GET",
1119
+ "path": "/v1/projects/{project_id}/honeytokens",
1120
+ "summary": "List honeytokens",
1121
+ "description": "Lists the project's honeytokens.",
1122
+ "parameters": [
1123
+ {
1124
+ "name": "project_id",
1125
+ "in": "path",
1126
+ "required": true,
1127
+ "type": "string",
1128
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1129
+ },
1130
+ {
1131
+ "name": "page_size",
1132
+ "in": "query",
1133
+ "required": false,
1134
+ "type": "number",
1135
+ "description": "Maximum number of items to return (1-100, default 20)."
1136
+ },
1137
+ {
1138
+ "name": "page_token",
1139
+ "in": "query",
1140
+ "required": false,
1141
+ "type": "string",
1142
+ "description": "Opaque token for cursor-based pagination."
1143
+ }
1144
+ ],
1145
+ "requestBodyType": "",
1146
+ "requestBodyRequired": false,
1147
+ "responseType": "{ honeytokens: ({ action: \"audit_only\" | \"kill\"; created_at: string; id: string; project_id: string; relation_name: string; schema_name?: string; updated_at: string })[]; next_page_token?: string }",
1148
+ "responseStatus": "200"
1149
+ },
1150
+ "createHoneytoken": {
1151
+ "operationId": "createHoneytoken",
1152
+ "method": "POST",
1153
+ "path": "/v1/projects/{project_id}/honeytokens",
1154
+ "summary": "Register a honeytoken",
1155
+ "description": "Registers a decoy (canary) relation for the project. Any agent statement\nthat references it is blocked and recorded as a canary_tripped audit event.\n",
1156
+ "parameters": [
1157
+ {
1158
+ "name": "project_id",
1159
+ "in": "path",
1160
+ "required": true,
1161
+ "type": "string",
1162
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1163
+ }
1164
+ ],
1165
+ "requestBodyType": "{ action: \"audit_only\" | \"kill\"; relation_name: string; schema_name?: string }",
1166
+ "requestBodyRequired": true,
1167
+ "responseType": "{ action: \"audit_only\" | \"kill\"; created_at: string; id: string; project_id: string; relation_name: string; schema_name?: string; updated_at: string }",
1168
+ "responseStatus": "201"
1169
+ },
1170
+ "getHoneytoken": {
1171
+ "operationId": "getHoneytoken",
1172
+ "method": "GET",
1173
+ "path": "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
1174
+ "summary": "Get a honeytoken",
1175
+ "description": "Returns a single honeytoken by ID.",
1176
+ "parameters": [
1177
+ {
1178
+ "name": "project_id",
1179
+ "in": "path",
1180
+ "required": true,
1181
+ "type": "string",
1182
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1183
+ },
1184
+ {
1185
+ "name": "honeytoken_id",
1186
+ "in": "path",
1187
+ "required": true,
1188
+ "type": "string",
1189
+ "description": "Unique honeytoken identifier (prefixed, e.g. hnt_xxx)."
1190
+ }
1191
+ ],
1192
+ "requestBodyType": "",
1193
+ "requestBodyRequired": false,
1194
+ "responseType": "{ action: \"audit_only\" | \"kill\"; created_at: string; id: string; project_id: string; relation_name: string; schema_name?: string; updated_at: string }",
1195
+ "responseStatus": "200"
1196
+ },
1197
+ "updateHoneytoken": {
1198
+ "operationId": "updateHoneytoken",
1199
+ "method": "PUT",
1200
+ "path": "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
1201
+ "summary": "Update a honeytoken",
1202
+ "description": "Updates a honeytoken's relation or action.",
1203
+ "parameters": [
1204
+ {
1205
+ "name": "project_id",
1206
+ "in": "path",
1207
+ "required": true,
1208
+ "type": "string",
1209
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1210
+ },
1211
+ {
1212
+ "name": "honeytoken_id",
1213
+ "in": "path",
1214
+ "required": true,
1215
+ "type": "string",
1216
+ "description": "Unique honeytoken identifier (prefixed, e.g. hnt_xxx)."
1217
+ }
1218
+ ],
1219
+ "requestBodyType": "{ action: \"audit_only\" | \"kill\"; relation_name: string; schema_name?: string }",
1220
+ "requestBodyRequired": true,
1221
+ "responseType": "{ action: \"audit_only\" | \"kill\"; created_at: string; id: string; project_id: string; relation_name: string; schema_name?: string; updated_at: string }",
1222
+ "responseStatus": "200"
1223
+ },
1224
+ "deleteHoneytoken": {
1225
+ "operationId": "deleteHoneytoken",
1226
+ "method": "DELETE",
1227
+ "path": "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
1228
+ "summary": "Delete a honeytoken",
1229
+ "description": "Removes a honeytoken from the project.",
1230
+ "parameters": [
1231
+ {
1232
+ "name": "project_id",
1233
+ "in": "path",
1234
+ "required": true,
1235
+ "type": "string",
1236
+ "description": "Unique project identifier (prefixed, e.g. prj_xxx)."
1237
+ },
1238
+ {
1239
+ "name": "honeytoken_id",
1240
+ "in": "path",
1241
+ "required": true,
1242
+ "type": "string",
1243
+ "description": "Unique honeytoken identifier (prefixed, e.g. hnt_xxx)."
1244
+ }
1245
+ ],
1246
+ "requestBodyType": "",
1247
+ "requestBodyRequired": false,
1248
+ "responseType": "",
1249
+ "responseStatus": "204"
1250
+ },
1089
1251
  "getProjectInsights": {
1090
1252
  "operationId": "getProjectInsights",
1091
1253
  "method": "GET",
@@ -2140,6 +2302,40 @@
2140
2302
  path: "/v1/projects/{project_id}/audit-logs/verify"
2141
2303
  }
2142
2304
  },
2305
+ policies: {
2306
+ recommendAgentPolicy: {
2307
+ method: "POST",
2308
+ path: "/v1/projects/{project_id}/agents/{agent_id}/policy-recommendation"
2309
+ },
2310
+ listPolicyProfiles: {
2311
+ method: "GET",
2312
+ path: "/v1/projects/{project_id}/policies"
2313
+ },
2314
+ createPolicyProfile: {
2315
+ method: "POST",
2316
+ path: "/v1/projects/{project_id}/policies"
2317
+ },
2318
+ getPolicyProfile: {
2319
+ method: "GET",
2320
+ path: "/v1/projects/{project_id}/policies/{policy_id}"
2321
+ },
2322
+ updatePolicyProfile: {
2323
+ method: "PUT",
2324
+ path: "/v1/projects/{project_id}/policies/{policy_id}"
2325
+ },
2326
+ deletePolicyProfile: {
2327
+ method: "DELETE",
2328
+ path: "/v1/projects/{project_id}/policies/{policy_id}"
2329
+ },
2330
+ dryEvalPolicy: {
2331
+ method: "POST",
2332
+ path: "/v1/projects/{project_id}/policy-evaluations"
2333
+ },
2334
+ replayPolicy: {
2335
+ method: "POST",
2336
+ path: "/v1/projects/{project_id}/policy-replays"
2337
+ }
2338
+ },
2143
2339
  anomalies: {
2144
2340
  listAnomalyAlerts: {
2145
2341
  method: "GET",
@@ -2330,40 +2526,32 @@
2330
2526
  path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}/rotate"
2331
2527
  }
2332
2528
  },
2333
- migrations: {
2334
- lintMigration: {
2335
- method: "POST",
2336
- path: "/v1/projects/{project_id}/migrations:lint"
2337
- }
2338
- },
2339
- policies: {
2340
- listPolicyProfiles: {
2529
+ honeytokens: {
2530
+ listHoneytokens: {
2341
2531
  method: "GET",
2342
- path: "/v1/projects/{project_id}/policies"
2532
+ path: "/v1/projects/{project_id}/honeytokens"
2343
2533
  },
2344
- createPolicyProfile: {
2534
+ createHoneytoken: {
2345
2535
  method: "POST",
2346
- path: "/v1/projects/{project_id}/policies"
2536
+ path: "/v1/projects/{project_id}/honeytokens"
2347
2537
  },
2348
- getPolicyProfile: {
2538
+ getHoneytoken: {
2349
2539
  method: "GET",
2350
- path: "/v1/projects/{project_id}/policies/{policy_id}"
2540
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
2351
2541
  },
2352
- updatePolicyProfile: {
2542
+ updateHoneytoken: {
2353
2543
  method: "PUT",
2354
- path: "/v1/projects/{project_id}/policies/{policy_id}"
2544
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
2355
2545
  },
2356
- deletePolicyProfile: {
2546
+ deleteHoneytoken: {
2357
2547
  method: "DELETE",
2358
- path: "/v1/projects/{project_id}/policies/{policy_id}"
2359
- },
2360
- dryEvalPolicy: {
2361
- method: "POST",
2362
- path: "/v1/projects/{project_id}/policy-evaluations"
2363
- },
2364
- replayPolicy: {
2548
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}"
2549
+ }
2550
+ },
2551
+ migrations: {
2552
+ lintMigration: {
2365
2553
  method: "POST",
2366
- path: "/v1/projects/{project_id}/policy-replays"
2554
+ path: "/v1/projects/{project_id}/migrations:lint"
2367
2555
  }
2368
2556
  },
2369
2557
  support: {
@@ -2457,6 +2645,11 @@ const operationsByPath = {
2457
2645
  path: "/v1/projects/{project_id}/agents/{agent_id}/rotate",
2458
2646
  operationId: "rotateAgentCredential"
2459
2647
  },
2648
+ "POST /v1/projects/{project_id}/agents/{agent_id}/policy-recommendation": {
2649
+ method: "POST",
2650
+ path: "/v1/projects/{project_id}/agents/{agent_id}/policy-recommendation",
2651
+ operationId: "recommendAgentPolicy"
2652
+ },
2460
2653
  "GET /v1/projects/{project_id}/anomalies": {
2461
2654
  method: "GET",
2462
2655
  path: "/v1/projects/{project_id}/anomalies",
@@ -2607,6 +2800,31 @@ const operationsByPath = {
2607
2800
  path: "/v1/health",
2608
2801
  operationId: "getHealth"
2609
2802
  },
2803
+ "GET /v1/projects/{project_id}/honeytokens": {
2804
+ method: "GET",
2805
+ path: "/v1/projects/{project_id}/honeytokens",
2806
+ operationId: "listHoneytokens"
2807
+ },
2808
+ "POST /v1/projects/{project_id}/honeytokens": {
2809
+ method: "POST",
2810
+ path: "/v1/projects/{project_id}/honeytokens",
2811
+ operationId: "createHoneytoken"
2812
+ },
2813
+ "GET /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
2814
+ method: "GET",
2815
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
2816
+ operationId: "getHoneytoken"
2817
+ },
2818
+ "PUT /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
2819
+ method: "PUT",
2820
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
2821
+ operationId: "updateHoneytoken"
2822
+ },
2823
+ "DELETE /v1/projects/{project_id}/honeytokens/{honeytoken_id}": {
2824
+ method: "DELETE",
2825
+ path: "/v1/projects/{project_id}/honeytokens/{honeytoken_id}",
2826
+ operationId: "deleteHoneytoken"
2827
+ },
2610
2828
  "GET /v1/projects/{project_id}/insights": {
2611
2829
  method: "GET",
2612
2830
  path: "/v1/projects/{project_id}/insights",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgbeam",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "TypeScript SDK for the PgBeam API — globally distributed PostgreSQL proxy platform",
5
5
  "type": "module",
6
6
  "exports": {