Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions platform/meta/design-docs/0095-security-audits.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ Migration `0065_security_audits.sql`, 11 tables in `security/schema.ts`:
`/v1/responses` (`openai/*`). The model must equal `scan.model_used`.
- Checks per call: fence and lease, policy on, host passed check 5, notices, session (40)
and scan call caps, token caps, provider-run tools refused (`tool_not_allowed`).
For models with a cached-input price, input tokens read from the prompt cache count
toward the input cap at that price divided by the full input price, rounded up per call.
All other input counts in full. Reports show the total without this discount.
- Money: the call's worst case is held on both month rows in one `UPDATE … WHERE spent +
worst ≤ cap RETURNING`, always scan → project → platform row. After the answer the hold
becomes tokens × list price; an unreadable or lost answer keeps the worst case (the meter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "security_scans" ADD COLUMN "input_token_discount" bigint DEFAULT 0 NOT NULL;
12 changes: 12 additions & 0 deletions platform/packages/api/drizzle/compatibility.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,18 @@
{
"platformVersion": "1.11.0",
"schemaDigest": "908e7aab4ad12e872e2e0e7e17bb5072971e9a260fb378f6f6abc43af68ea883"
},
{
"platformVersion": "1.12.0",
"schemaDigest": "b1acb4109dac821bd00863007cb10b8ba8faa479e6feb26aaf7e28f35c288e97"
},
{
"platformVersion": "1.12.1",
"schemaDigest": "b1acb4109dac821bd00863007cb10b8ba8faa479e6feb26aaf7e28f35c288e97"
},
{
"platformVersion": "1.12.2",
"schemaDigest": "b1acb4109dac821bd00863007cb10b8ba8faa479e6feb26aaf7e28f35c288e97"
}
]
}
Loading