What Pecta stores
Pecta persists only evaluation metadata. User payloads are never transmitted, queued, or written to disk.
The
@pecta/core SDK enforces this boundary before any network call is made: it strips the EvaluationResult down to the metadata fields above and discards everything else, including any details objects that might reference user data.
API key types
Pecta issues two key types with different trust levels:
Keys are stored securely and never retrievable after creation. The plaintext is shown exactly once at creation time.
HMAC signing for telemetry
When you initialisePectaTelemetry with hmac: true, every batch POST to /v1/ingest includes an X-Pecta-Signature header:
HMAC-SHA256(secretKey, requestBody). The Pecta API verifies the signature before accepting the batch, ensuring that telemetry cannot be spoofed or replayed by a third party who only has your publishable key.
sk_live_ secret key. Keep it in an environment variable or a secrets manager — never hardcode it.
Gates run locally; only results reach the cloud
In SDK and proxy mode, gate evaluation is entirely local:- Your agent produces output.
engine.evaluate()runs gates inside your process (< 15 ms for RTB, < 50 ms for MCP).- The
EvaluationResultis returned to your code. telemetry.track(result)strips the result to metadata and adds it to an in-memory buffer.- The buffer is flushed asynchronously to
POST /v1/ingestin the background.
In REST API mode (Mode 3), gate evaluation runs server-side on Pecta infrastructure. This is the only mode in which agent output travels over the network. If this is a concern, use the SDK or proxy mode instead.
Per-mode key requirements
Additional hardening
- Every
/v1/*endpoint is scoped to the authenticated organization — you can never read another organization’s data even with a valid key. - All endpoints are rate-limited. Exceeding the limit returns
429 RATE_LIMITED. - JSON-RPC messages larger than 1 MB are dropped by the proxy before gate evaluation (
--max-message-size). - No secrets appear in proxy or SDK logs. The publishable key prefix (
pk_live_) is safe to log; full key values are not.