TheDocumentation Index
Fetch the complete documentation index at: https://docs.prflght.xyz/llms.txt
Use this file to discover all available pages before exploring further.
@prflght/sdk package is the lowest-level way to integrate Prflght into your agent. You call firewall.check() before sending any transaction, receive attestation instructions on allow, and catch FirewallDenyError on deny. Every other Prflght integration is built on top of this SDK.
Installation
Initialization
Create aFirewall instance once at startup and reuse it for every transaction check. You need two values:
apiUrl— the Prflght API base URL:https://api.prflght.xyzagentId— your agent’s Solana wallet public key as a base58 string
The check() method
Callfirewall.check() before sending any transaction. Pass the transaction as a base64-encoded serialized VersionedTransaction.
On allow, check() returns an object with an instructions array — these are attestation instructions you must prepend to your transaction before submitting it on-chain.
On deny, check() throws a FirewallDenyError with a .reason string describing why the transaction was blocked.
You must prepend the returned attestation instructions to your transaction before sending. The Prflght on-chain program verifies the attestation at execution time — submitting without them will cause the transaction to fail.
Full example
Error handling
FirewallDenyError is thrown whenever Prflght blocks a transaction. Catch it separately from other errors so you can handle policy denials without masking unexpected failures.
| Property | Type | Description |
|---|---|---|
err.reason | string | Human-readable explanation of why the transaction was denied |
"notional exceeds policy limit"— the transaction value exceeds your agent’s configured spending cap"program not in allowlist"— the transaction calls a Solana program your policy does not permit"slippage exceeds policy limit"— the swap slippage tolerance is above your configured threshold"protocol health check failed"— the DeFi protocol involved has TVL below your minimum health threshold
