pgbeam 0.2.2__tar.gz → 0.2.4__tar.gz

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.
@@ -1,5 +1,17 @@
1
1
  # @pgbeam/python-sdk
2
2
 
3
+ ## 0.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 631f106: feat(contentscan): a flagged result records a content_flagged audit entry
8
+
9
+ ## 0.2.3
10
+
11
+ ### Patch Changes
12
+
13
+ - a5fbfca: feat(proxy): scan result content on the wire for agent-directed text
14
+
3
15
  ## 0.2.2
4
16
 
5
17
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pgbeam
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Python SDK for the PgBeam API, a Postgres proxy for safe AI agent access with policy enforcement in the wire protocol
5
5
  Project-URL: Homepage, https://pgbeam.com
6
6
  Project-URL: Documentation, https://pgbeam.com/docs/python-sdk
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pgbeam"
7
- version = "0.2.2"
7
+ version = "0.2.4"
8
8
  description = "Python SDK for the PgBeam API, a Postgres proxy for safe AI agent access with policy enforcement in the wire protocol"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -602,7 +602,7 @@ class AuditChainVerification(TypedDict):
602
602
  verified_at: str
603
603
 
604
604
 
605
- # Coarse outcome filter that groups audit events. `allow` = query, auto_approved; `block` = blocked, budget_exhausted, auth_failed, credential_expired, canary_tripped, rejected, approval_expired; `mask` = masked; `truncate` = truncated. The progress events approval_requested, approved and migration_flagged group under no decision: each belongs to a statement that goes on to record its own outcome, so grouping them would count that statement twice. auto_approved is not one of those: it is the only row an auto-approved write produces, so it groups under `allow` like any other completed statement.
605
+ # Coarse outcome filter that groups audit events. `allow` = query, auto_approved; `block` = blocked, budget_exhausted, auth_failed, credential_expired, canary_tripped, rejected, approval_expired; `mask` = masked; `truncate` = truncated. The progress events approval_requested, approved and migration_flagged group under no decision, and so does content_flagged: each belongs to a statement that records its own outcome as well, so grouping them would count that statement twice. auto_approved is not one of those: it is the only row an auto-approved write produces, so it groups under `allow` like any other completed statement.
606
606
  AuditDecision = Literal["allow", "block", "mask", "truncate"]
607
607
 
608
608
 
@@ -617,7 +617,7 @@ class AuditLogEntry(TypedDict):
617
617
  credential_id: NotRequired[str | None]
618
618
  # Data plane region that served the statement.
619
619
  region: NotRequired[str]
620
- # Event type (query, auto_approved, blocked, masked, truncated, budget_exhausted, canary_tripped, rejected, approval_expired, auth_failed, credential_expired, approval_requested, approved, migration_flagged, entries_dropped). `approved` is a statement a reviewer released from an approval hold, which then runs and records its own outcome; `auto_approved` is a write a policy waved through without a human, and is the only row that write produces.
620
+ # Event type (query, auto_approved, blocked, masked, truncated, budget_exhausted, canary_tripped, rejected, approval_expired, auth_failed, credential_expired, approval_requested, approved, migration_flagged, content_flagged, entries_dropped). `approved` is a statement a reviewer released from an approval hold, which then runs and records its own outcome; `auto_approved` is a write a policy waved through without a human, and is the only row that write produces; `content_flagged` is not an outcome at all, but the result-content scan reporting instruction-shaped text in the values a statement returned, which were forwarded to the agent unchanged.
621
621
  event: str
622
622
  # The statement text (truncated).
623
623
  sql: NotRequired[str]
@@ -2091,9 +2091,9 @@ class PolicyProfile(TypedDict):
2091
2091
  egress_bytes_per_day: NotRequired[int]
2092
2092
  # Hard cap on rows a single write (INSERT/UPDATE/DELETE) may affect. A write whose affected-row count would exceed this is executed inside a transaction, checked, and rolled back so nothing persists, then blocked. Enforced independently of human approval. 0 means unlimited.
2093
2093
  max_affected_rows: NotRequired[int]
2094
- # Result-content scanning, accepted and stored but not yet enforced: no released proxy build reads this field, so today every value behaves like off. Once enforcement ships on the data-plane relay path, values on their way out to an agent will be checked for instruction-shaped content (stored prompt injection). off will scan nothing and cost nothing. annotate will forward every value unchanged and record what it found. block will additionally refuse the statement with an error naming the column, and never drop a row silently. A proxy build without result-content scanning ignores this field.
2094
+ # Result-content scanning, enforced on the data-plane relay path: values on their way out to an agent are checked for instruction-shaped content (stored prompt injection). off scans nothing and costs nothing. annotate scans and forwards every value unchanged, recording what it found. block is accepted and scans exactly as annotate does, but refusing the statement is not implemented yet, so today it also forwards every value. No mode drops or rewrites a row. A flagged statement records one content_flagged audit entry naming the columns, the techniques and whether the scan covered the whole result, alongside the proxy's own metrics and logs; the entry carries no value from the row itself, and the anomaly feed and the webhook stream are not wired to it yet. Values the scan cannot read (binary-format columns, columns this profile masks, and anything past content_scan_max_bytes) are counted as unscanned rather than reported clean. A proxy build older than result-content scanning ignores this field.
2095
2095
  content_scan_mode: NotRequired[Literal["off", "annotate", "block"]]
2096
- # Byte budget for one statement's content scan, spanning all values in the result. Stored but not yet read by any released proxy build, like content_scan_mode. Once enforced, values past it are reported unscannable rather than skipped quietly. 0 uses the scanner default (4 MiB), which covers an interactive result set and deliberately does not cover a bulk export.
2096
+ # Byte budget for one statement's content scan, spanning all values in the result. Values past it are reported unscannable rather than skipped quietly. The budget covers a whole statement, so the statements of one simple-query batch share it rather than each getting a fresh allowance. 0 uses the scanner default (4 MiB), which covers an interactive result set and deliberately does not cover a bulk export.
2097
2097
  content_scan_max_bytes: NotRequired[int]
2098
2098
  # When the policy profile was created.
2099
2099
  created_at: str
@@ -2139,9 +2139,9 @@ class PolicyProfileInput(TypedDict):
2139
2139
  egress_bytes_per_day: NotRequired[int]
2140
2140
  # Hard cap on rows a single write (INSERT/UPDATE/DELETE) may affect. A write whose affected-row count would exceed this is executed inside a transaction, checked, and rolled back so nothing persists, then blocked. Enforced independently of human approval. 0 means unlimited.
2141
2141
  max_affected_rows: NotRequired[int]
2142
- # Result-content scanning, accepted and stored but not yet enforced: no released proxy build reads this field, so today every value behaves like off. Once enforcement ships on the data-plane relay path, values on their way out to an agent will be checked for instruction-shaped content (stored prompt injection). off will scan nothing and cost nothing. annotate will forward every value unchanged and record what it found. block will additionally refuse the statement with an error naming the column, and never drop a row silently. A proxy build without result-content scanning ignores this field.
2142
+ # Result-content scanning, enforced on the data-plane relay path: values on their way out to an agent are checked for instruction-shaped content (stored prompt injection). off scans nothing and costs nothing. annotate scans and forwards every value unchanged, recording what it found. block is accepted and scans exactly as annotate does, but refusing the statement is not implemented yet, so today it also forwards every value. No mode drops or rewrites a row. A flagged statement records one content_flagged audit entry naming the columns, the techniques and whether the scan covered the whole result, alongside the proxy's own metrics and logs; the entry carries no value from the row itself, and the anomaly feed and the webhook stream are not wired to it yet. Values the scan cannot read (binary-format columns, columns this profile masks, and anything past content_scan_max_bytes) are counted as unscanned rather than reported clean. A proxy build older than result-content scanning ignores this field.
2143
2143
  content_scan_mode: NotRequired[Literal["off", "annotate", "block"]]
2144
- # Byte budget for one statement's content scan, spanning all values in the result. Stored but not yet read by any released proxy build, like content_scan_mode. Once enforced, values past it are reported unscannable rather than skipped quietly. 0 uses the scanner default (4 MiB), which covers an interactive result set and deliberately does not cover a bulk export.
2144
+ # Byte budget for one statement's content scan, spanning all values in the result. Values past it are reported unscannable rather than skipped quietly. The budget covers a whole statement, so the statements of one simple-query batch share it rather than each getting a fresh allowance. 0 uses the scanner default (4 MiB), which covers an interactive result set and deliberately does not cover a bulk export.
2145
2145
  content_scan_max_bytes: NotRequired[int]
2146
2146
 
2147
2147
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes