Skip to main content
Guardrails limit what your server can sign with the wallets your project owns.

What Guardrails restrict

Your project owns some wallets outright: wallets created through the REST API, and pregenerated wallets that no user has claimed. Your backend can already sign anything with them. A Guardrail is a policy that takes cases away, so a bug or a bad input cannot make your backend sign something you never intended. Each Guardrail rule has one of these effects: Any other allow rule fails with guardrail_effect_invalid, because the wallet can already sign. Requests that no Guardrail blocks sign as usual. When several active Guardrails match a request, they all apply: deny wins over require_approval, so a block in any of them stops the request. For EVM transactions and Para-managed sponsored transfers, an execution gas limit caps the maximum gas cost with one condition, independently of transfer or contract argument limits.
Guardrails apply only while a wallet belongs to your project. When a user claims a pregenerated wallet, it becomes user-owned, and Requests govern it instead. See How permissions work.
Permissions supports EVM, Solana, Cosmos, Stellar and Sui wallets. Each policy targets one wallet type, so create a separate policy for each wallet type you want rules for. A policy covers every network of its wallet type unless you list specific networks.

Before you start

You need:
  • A Development API key. Policies are written and tested on Development keys, which use Para’s beta environment. Production keys are read-only in the Developer Portal.
  • App-owned wallets created with that key, and a server that signs with them.
  • For require_approval rules only: each wallet must be bound to an authorization scope. A request that needs approval from an unbound wallet returns 403 FORBIDDEN.
Guardrails protect you from mistakes in your own code. They are not a defense against a leaked secret key, so keep the key secret and rotate it if it is exposed.

Choose how your server signs

Guardrails apply to app-owned wallets whichever SDK your server signs with, and both SDKs report the same outcomes:
The REST SDK also makes retries safe with idempotency keys. Migrate from pregenerated wallets covers the move.
A server that signs with a session imported from a signed-in user is signing that user’s wallet. Requests apply to it, not Guardrails. See How permissions work, and Review links on a server for the review that follows. To sign while the user is away without their session, use signing delegation.

REST SDK outcomes

The REST SDK calls the REST API, so your server receives these responses. Para checks every request to the signing routes (sign-transaction, sign-message, sign-typed-data, sign-authorization and sign-raw) and to transfer against the wallet’s active Guardrails before it signs. Each response has one of four outcomes: Send every signing and transfer request with an Idempotency-Key taken from your own records, such as a payment ID. Para ties an approval to that key, and after a request succeeds it returns the stored response for repeats of the same key and body for 24 hours.
ParaRestError carries the HTTP status, the code and the parsed response on body.

Signed

A request that no Guardrail stops signs as usual and returns the route’s normal response. Repeating it with the same Idempotency-Key and body returns the stored response instead of signing again.
While Permissions is on, raw signatures follow the same defaults as other signing requests: an app-owned wallet signs them, and a user-owned wallet sends them to the user for review. Rules that name the raw_signature action, and rules with "actions": "all", can change that. Raw signatures are sign-raw requests, messages from Solana, Stellar and Sui wallets, and REST sign-message requests from a Cosmos wallet that do not pass walletType: "EVM". The SDKs sign messages from Cosmos wallets as EVM sign_message requests. Raw signatures carry no network a selector can name, so only a policy without chainId governs them. A rule that names raw_signature can read only para.wallet.* facts. The Developer Portal forms cannot create one, so write it in policy JSON, with Edit JSON in the Developer Portal or with the CLI.

Denied

Para refuses to sign and returns 403. Nothing is signed or broadcast.
403 POLICY_DENIED
deniedBy holds one entry. policyId and ruleId appear when a rule decided the outcome. Common reason values:
When a standard rule cannot be judged only because part of the request could not be decoded, Para skips that rule. This applies to allow, require_approval and deny, including Guardrails.Other rules and the Para baseline decide the request; an app-owned wallet may sign, while a user-owned wallet may need user review. A numeric limit therefore constrains decoded amounts, not every request that could move that asset.This exception does not skip an indeterminate Para baseline rule, a missing argument in a fully decoded request, a missing gas or non-request fact, an invalid or stale fact, or a fact-source error. It also does not skip a rule that cannot be judged because of an ABI lookup timeout, rate limit or explorer error. The same holds for a rule on request.safe.abi.selector, request.safe.contract.address, request.safe.args[n] or request.safe.uintArgs[n] when the ABI lookup for the Safe’s call failed in one of those ways, or when the call’s calldata is not in its canonical ABI encoding. Those rules still block the request.On Solana, Cosmos, Stellar and Sui, Para judges a transaction with 2 to 64 calls one call at a time. Each call carries its own recipient, target and source account, and the transaction’s total of its asset as its amount. A call that Para reads only by its target, such as a program call, or cannot read, is a decode gap: Para skips a rule that needs a fact the call does not have, and the other rules and the Para baseline decide that call.Para judges a transaction with one call, or with more than 64 calls, as one request. It adds up the transfers in that request when every action is a transfer, Para reads every amount, and every transfer moves the same asset. The total is in request.value.* for the native asset or request.token.* for a token, and amount rules are judged on it. request.to is set only when every transfer has the same recipient, and request.target only when every transfer has the same target. On Cosmos, a request whose only message is a contract call with funds in one asset also carries the total of those funds.Apart from the cases below, such a request with more than one action, or whose actions Para cannot count, stays outside this exception. A rule that needs a fact the request does not carry blocks it, such as a request.to rule on transfers to two recipients, or an amount rule on a request with a transfer and a program call. Para skips the rule in these cases:
  • Every action is a transfer and Para cannot read at least one amount. Para skips a rule on request.value.* or request.token.*, but a rule on request.to or request.target still blocks the request.
  • On Stellar, the only operation is a path payment that converts assets, or a claimable balance. Para skips a rule on request.to, unless the path payment converts between XLM and another asset.
  • On Cosmos, the only message is an IBC transfer. Para skips a rule on request.to.
An approval does not remove these checks; an indeterminate rule can still deny the approved request. The facts reference lists which actions provide each fact.

Approval required

When the deciding rule is a require_approval rule with an approval requirement, Para opens an approval case instead of signing and returns 403:
403 POLICY_REVIEW_REQUIRED
string
The approval case for this request. Read its progress with getApprovalCase(approvalCaseId) or GET /v1/permissions-v2/approval-cases/{caseId}.
string
pending for a new case. When you resend a request whose case has ended, it can hold that case’s final status: completed, rejected, expired, invalidated or cancelled.
string
The rule that requires approval, as matched:<layer>:<ruleId>.
string
The ID of the policy decision Para recorded for this request. Include it when you contact Para about a decision.
The approvers named in the rule’s approval requirement decide in the Para Portal. Your secret key can read and cancel the case, but it cannot approve on anyone’s behalf. A deciding require_approval rule without an approvalRequirement opens an ordinary review instead, which your backend approves or rejects.

Name the user behind a request

When your backend signs on behalf of one of your users, add initiatorUserId with that user’s Para user ID to the signing or transfer request. Para records the user as the requester of any approval case the request opens, and that user cannot approve or reject the case, even if the approval requirement names them.
The user must already be linked to your app. Otherwise the request fails with 400 INVALID_REQUEST and the message user is not linked to this app. Send the same initiatorUserId every time you resend the request.

Continue after approval

For a response with approvalCaseId, Para ties the case to the request’s Idempotency-Key, or to a hash of the request body when you send no key. The case stays open for up to 7 days.
1

Store the case with the request

Save approvalCaseId next to the Idempotency-Key and the request body.
2

Wait for the approvers

Poll getApprovalCase(approvalCaseId) until status is completed.
3

Resend the identical request

Send the same body with the same Idempotency-Key. Para evaluates it again, finds the completed case and signs. A completed case can be used for one signature.
A case that ends without approval cannot sign. If the case is rejected, expired, invalidated or cancelled, resending with the same key is refused again. To try again, send the request with a new Idempotency-Key, which opens a new case.An approval case that has not been used to sign is invalidated when the active policies that apply to its request change, for example when a policy is replaced, activated or turned off. An invalidated case cannot complete, so start a new request to open a new case.
After a POLICY_REVIEW_REQUIRED response that carries approvalCaseId, sending a different body or a different initiatorUserId with the same Idempotency-Key returns 409 CONFLICT with the message request already has a different conditional approval case.

Cancel a pending case

If you no longer need the request, cancel its case so approvers cannot approve it. Call cancelApprovalCase(approvalCaseId) in the REST SDK, or send POST /v1/permissions-v2/approval-cases/{caseId}/cancel. Only a pending case can be cancelled. The case ends with status cancelled and terminalReason case_cancelled. When a pending transaction from a user’s wallet is waiting on the case, Para discards it, so that request never signs. A request that should still go ahead needs a new attempt, which opens a new case. The new attempt needs a new Idempotency-Key. Cancelling a case that is no longer pending returns 409 CONFLICT with the message conditional approval case is not pending.

Ordinary review

When the deciding require_approval rule has no approval requirement, Para opens an ordinary review that your backend decides with your secret key. The 403 carries reviewId and no approval case fields:
403 POLICY_REVIEW_REQUIRED
1

Store the review with the request

In the REST SDK, the request throws ParaRestError, and reviewId is a field of error.body. Save reviewId next to the Idempotency-Key and the request body.
2

Approve within 5 minutes

Call approveReview(reviewId), or send POST /v1/permissions-v2/reviews/{reviewId}/approve. Check that the returned status is approved.
3

Resend the identical request

Send the same body with the same Idempotency-Key. You can also add reviewId to the body. Para evaluates the request again and signs. The review then becomes consumed, so it covers one signature.
The approve route returns 200 with the review’s current status, even when the review has already ended. Para re-evaluates the resend, so the request and the active policy must still match the review. If your backend decides against the request, call rejectReview(reviewId) or send POST /v1/permissions-v2/reviews/{reviewId}/reject. A resend then returns 403 POLICY_DENIED, and deniedBy[0].reason is review-rejected.
A review expires 5 minutes after Para opens it, whether or not you approved it. The 403 body does not show the review’s status. The approve route returns status: "expired" for it. To try again, send the request with a new Idempotency-Key. Para opens a new review, and the 403 carries its new reviewId. Approve that reviewId, not the expired one.
Sponsored transfers handle reviews differently. A rule with an approval requirement is not supported there, and the tracked transfer fails with failureCode SPONSORSHIP_CONDITIONAL_APPROVAL_UNSUPPORTED. An ordinary review pauses the tracked transfer at stage requires_action with its reviewId. After you approve it, call resumeRestTransaction(walletId, transactionId, { reviewId }) as Gas sponsorship describes. The approveReview and rejectReview references list every response and error.

Spend accounting failed

Para could not record spend against a spending limit, for a reason other than the limit itself. It returns 500 with code SPEND_ACCOUNTING_FAILED and the message Windowed spend accounting failed, and nothing is signed. Retry with backoff, using the same Idempotency-Key and body. A request that would exceed a limit is a denial with the reason windowed-spend-limit-exceeded, not this error.

Server SDK outcomes

The server SDK signs a pregenerated wallet after you load its user share with setUserShare. When no Guardrail stops the request, signTransaction and signMessage return { signature }, as they do without Permissions. Errors from its signing worker keep their code, status and data, so your code can act on each outcome.

Handle a denial

When a policy denies the request, the signing call rejects instead of opening a review. Para’s refusal has code: "POLICY_DENIED" and status: 403. When a rule decided the denial, data.deniedBy names it with the same { policyId, ruleId, reason } entries the REST API returns. A spending limit reached while Para reserved the spend reports windowed-spend-limit-exceeded. The web, React, React Native and server SDKs reject with an Error named ParaApiError that carries this code, status and data. To identify it, check error instanceof Error && isParaApiError(error), or check its code property.

Handle a required approval

When a deciding require_approval rule has an approvalRequirement, Para opens an approval case and the signing call throws an error with code: "POLICY_REVIEW_REQUIRED" and status: 403. error.data holds the same approvalCaseId, approvalCaseStatus, artifactId and reason fields as the REST response.
When the deciding rule requires approval without an approvalRequirement, error.data carries an ordinary reviewId. Your backend approves or rejects it with your app’s server secret through the routes in Pending transaction review. After approved, retry identical SDK signing input without resumeApprovalCaseId, only while the approval is unused and unexpired and the request and policy binding still match.
payouts.ts
Store the approvalCaseId with the transaction. To read the case’s progress, call getApprovalCase(approvalCaseId) on a @getpara/rest-sdk client created with your secret key. Then call signPayout again with the identical transaction and the case ID. The result depends on the case: To try again after a case has ended or been used, sign the transaction without resumeApprovalCaseId, which opens a new case. To drop a request while its case is pending, cancel the case with cancelApprovalCase(approvalCaseId) on the same REST SDK client. Pass initiatorUserId to signTransaction or signMessage to name the Para user your server is acting for. It works as it does on the REST API: the user must be linked to your app, and cannot approve or reject the case. Para reads it only for wallets your project owns.
Send the same initiatorUserId on every retry and resume of the transaction. A different or missing value fails with status 409.
When you sign EIP-712 typed data through the viem v2 or ethers v6 integration or the wagmi connector, the Para SDK sends the typed data with its hash. Para checks that the two match and evaluates the request as sign_typed_data, the same as the REST API’s sign-typed-data route, so request.typedData.primaryType, request.approvalLike and the chain ID from the typed data’s domain apply. Para evaluates these SDK requests as sign_message, with no chain ID: EIP-7702 authorizations, typed data signed through the viem v1 or ethers v5 integration, and a typed data hash that your code signs with signMessage. The sign_authorization action and its facts apply only to the REST API’s sign-authorization route, which the REST SDK calls.
When your server signs for a signed-in user, any review opens in the Para Portal. A server has no window to open it in, so the default managed review mode fails with OpenPopup is not implemented in the ServerUtils class. Choose one of these instead:
  • Set transactionReviewMode: "handoff" when you create the client. The signing call returns the review link instead of waiting, and you send it to the user.
  • Keep managed mode and pass onTransactionReviewUrl to the signing call. The SDK hands you the link, then waits for the user’s decision as it would in a browser.
server.ts
Send reviewUrl to the user. Once they approve, sign the identical transaction again to get the signature. Wallet integrations that must return a signature, such as the viem and ethers signers, throw TransactionReviewRequired in handoff mode instead, with the same transactionReviewUrl and pendingTransactionId.

Add a Guardrail

Create the policy on a Development key, run every rule against beta with your server code, then request a production review. Start in the Developer Portal; move to JSON for rules the forms cannot express.
Your production server signs as it does today until Para publishes a reviewed policy to your Production key. Guardrails you activate on a Development key change signing on beta only.

Go further

Start from a tested Guardrail, hold some requests for approval, manage approvers and wallet bindings from your backend, or sign with users’ wallets while they are away.