A deterministic risk layer for autonomous trading agents.
Collar Guardrail provides deterministic, advisory risk checks for autonomous trading agents operating on Robinhood Chain.
deny response does not itself prevent an agent
from submitting a transaction on-chain. The integrating agent
is responsible for honoring the verdict.
Quickstart
Get up and running in under 2 minutes. This complete Python script demonstrates how to request a nonce, sign it, authenticate, and run a pre-trade risk check.
import requests
from eth_account import Account
from eth_account.messages import encode_defunct
# Configuration
BASE_URL = "https://backendai-x4m1.onrender.com"
PRIVATE_KEY = "0x..." # Your agent's private key
account = Account.from_key(PRIVATE_KEY)
wallet_address = account.address
# Step 1: Get authentication nonce
res = requests.get(f"{BASE_URL}/api/v1/auth/nonce", params={"address": wallet_address})
res.raise_for_status()
message_to_sign = res.json()["message"]
# Step 2: Sign EIP-191 message
message = encode_defunct(text=message_to_sign)
signature = Account.sign_message(message, private_key=PRIVATE_KEY).signature.hex()
# Step 3: Exchange signature for access token
auth_res = requests.post(f"{BASE_URL}/api/v1/auth/wallet", json={
"address": wallet_address,
"signature": signature
})
auth_res.raise_for_status()
token = auth_res.json()["access_token"]
# Step 4: Analyze a trade before submission
headers = {"Authorization": f"Bearer {token}"}
trade_payload = {
"wallet": wallet_address,
"asset": "NVDA",
"side": "buy",
"amount": 10.0,
"contract_address": "0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",
"request_id": "quickstart-test-001"
}
trade_res = requests.post(f"{BASE_URL}/api/v1/analyze/trade", json=trade_payload, headers=headers)
print("Trade Verdict Response:", trade_res.json())
Why Collar exists
Robinhood Chain is a blockchain built for autonomous trading agents. Agents on it are fast, tireless, and increasingly handling real money.
They are also probabilistic. Every LLM-based agent can hallucinate a token address, ignore its own risk rules under pressure, or be talked into a bad trade by a prompt injection hidden in some piece of data it happened to read. When that happens, the agent does not stop. It executes.
The existing risk tooling was not built for this. Most platforms in the space use machine learning to monitor activity across many chains. That is the right model for institutional security. It is not designed for the independent agent developer who needs a deterministic second opinion in one HTTP call.
Collar does not try to be smarter than the agent. It tries to be predictable in a way the agent cannot be. It sits outside the agent's runtime, at the last point before a trade is signed, and returns one of three answers.
| Verdict | What it means |
|---|---|
| allow | No rule was violated. Proceed. |
| warn | Something is off — high risk score, nearing a limit, unusual frequency. Proceed with caution, or don't. |
| deny | A rule was violated. Do not submit the trade. The reason is in the response. |
When to use Collar
You're shipping an autonomous agent
Add one HTTP call before every trade. If the verdict is deny, don't sign. That's the entire integration.
You run a frontend or a bot
Call Collar before submitting a user's trade. Show the verdict in your UI. Turn a deny into a stop button.
You're a DeFi protocol
Use Collar as a second opinion before liquidations or large position changes. Deterministic verdicts are auditable.
You just want to see what happens
Hit the unauthenticated demo endpoint, or connect a wallet in preview mode. No COLR required pre-launch.
How Collar differs
There are already tools that watch on-chain activity. Most of them are excellent — for their intended audience. Collar is built around four choices that put it in a different shape.
| Design choice | What it means |
|---|---|
| REST API, not MCP | Most agent guardrails ship as MCP servers, which only work for agents whose client speaks MCP. Collar is a plain HTTP API. Any language, any framework, any agent can call it. |
| Deterministic, not ML | Most risk platforms use machine learning. That is the right model for institutional security. It is not the right model for a guardrail that needs to be predictable. Collar uses fixed rules. Same input, same output. |
| Advisory, not enforced | Collar returns a verdict. It does not, today, block a transaction at the sequencer level. The integrating agent is responsible for honoring a deny. Stated plainly so no one assumes a guarantee that isn't there yet. |
| Stock-Token aware | Robinhood Chain's tokenized equities have failure modes generic tools don't model: corporate actions that pause the oracle, weekend staleness, multiplier adjustments. Collar reads oraclePaused() and applies stock-specific staleness windows. |
Collar is not claiming to be the first risk tool on Robinhood Chain. It is claiming to be a specific shape of one: API-first, deterministic, and stock-token aware.
Overview
Collar evaluates trade requests against a deterministic policy before the integrating agent submits them for execution. Each request is checked against:
- USD trade notional limits based on wallet COLR tier.
- Real-time Chainlink oracle prices for the traded asset.
- Corporate-action pause state (
oraclePaused()) for tokenized equities. - Feed staleness relative to heartbeat.
- Asset restrictions configured for eligible tiers.
- Potential runaway activity based on request frequency.
COLR is an access and tier-gating token
COLR is not the trade currency. Agents can submit trades involving other supported assets, such as ETH, USDG, or tokenized equities. The wallet's COLR balance determines the access tier:
| Tier | COLR balance | Maximum trade value |
|---|---|---|
| TIER 1 | 5,000+ COLR | $5,000 USD |
| TIER 2 | 10,000+ COLR | $10,000 USD |
| TIER 3 | 25,000+ COLR | $25,000 USD |
While COLR has not launched, the API grants a default Tier 1 to every authenticated wallet. See preview-tier testing below.
Verdicts
| Decision | Meaning |
|---|---|
| allow | No configured rule violation was detected. Proceed. |
| warn | A potential runaway-agent pattern, elevated risk score, or nearing-limit condition. The integrating agent decides its own policy: log, slow down, or alert. |
| deny | One or more policy rules were violated. Do not submit the trade. Reasons are always included. |
Verdicts are advisory. Collar does not currently enforce the decision at the blockchain or sequencer level.
Asset registry
Returns every symbol and its official contract address. Robinhood adds new tokens over time — refresh this periodically rather than caching indefinitely.
[
{ "symbol": "NVDA", "contract_address": "0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC", "is_native": false },
{ "symbol": "ETH", "contract_address": "NATIVE", "is_native": true }
]
Blocked-asset policy (Tier 2+)
Returns the wallet's current policy configuration.
{
"blocked_assets": ["MEME", "XYZ"],
"editable": true
}
Updates the blocked-asset list for Tier 2 and Tier 3 wallets.
{ "blocked_assets": ["MEME", "XYZ"] }
Trade requests against a blocked asset receive a deny verdict.
Rate limiting and runaway-agent detection
Collar tracks request frequency over a rolling 60-second window, per wallet, in Redis.
- Tier 1: warn above 5 trades/min, deny above 15.
- Tier 2: warn above 10, deny above 25.
- Tier 3: warn above 20, deny above 50.
There is no separate API-level rate limit on /analyze/trade beyond this — it is the runaway-agent protection.
While COLR has not launched, every wallet is granted a default Tier 1. To test Tier 2 or Tier 3 behavior, add the header X-Preview-Tier: 2 (or 3). This header is silently ignored once COLR launches and a real balance check takes over.
Authentication
Authentication uses wallet signatures rather than API keys. The same private key the agent already holds for trading is used to sign a one-time challenge.
Request a one-time nonce and the exact message to sign. The nonce expires in 5 minutes and can only be used once.
Submit the wallet address and an EIP-191 signature of the message from the previous step.
{
"address": "0x1234567890123456789012345678901234567890",
"signature": "0x..."
}
{
"access_token": "eyJ...",
"expires_in_seconds": 3600,
"preview_mode": true
}
Authenticated API requests use Authorization: Bearer <access_token>. To end a session immediately, call:
Analyze a trade
Submit a trade request for deterministic policy evaluation. Requires authentication.
Request
{
"wallet": "0x1234567890123456789012345678901234567890",
"asset": "NVDA",
"side": "buy",
"amount": 12.5,
"contract_address": "0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",
"request_id": "a1b2c3d4-..."
}
Fields
| Field | Type | Description |
|---|---|---|
wallet | string | Wallet address authenticated by the session. Must match the JWT. |
asset | string | Token symbol (e.g. NVDA, ETH, USDG). |
side | string | buy or sell. |
amount | number | Quantity of the asset — not a pre-computed USD value. |
contract_address | string | Must exactly match the official contract for that symbol. |
request_id | string (optional) | Idempotency key. Reusing one within 5 minutes replays the original verdict. |
Response
{
"decision": "allow",
"reasons": ["All guardrail checks passed"],
"tier": 1,
"max_trade_usd": 5000.0,
"calculated_notional_usd": 2728.72,
"price_usd": 218.298,
"price_source": "oracle",
"risk_score": 18,
"timestamp": 1757520000,
"request_id": "a1b2c3d4-..."
}
Error responses
| Status | Meaning |
|---|---|
| 400 | Malformed request (bad wallet format, invalid trade fields). |
| 401 | Missing / expired / invalid token — re-authenticate. |
| 403 | Wallet doesn't meet the tier threshold, or wallet mismatch. |
| 429 | Rate limit hit on auth endpoints (20 req/min/IP). |
| 5xx | Backend issue — retry with backoff, don't assume "allow". |
What's next
| Item | Why it matters |
|---|---|
| Behavioral guardrails | Cooldown after loss, forced break after consecutive losses. |
| On-chain P&L analysis | Read recent trades from Robinhood Chain and derive realized P&L. |
| Honeypot / rug-pull detection | Contract-level checks: mint authority, ownership, sell tax. |
| Memecoin pricing | Read price directly from Uniswap V4 pools without Chainlink feed. |
| Agent SDK (Python + JS) | Thin client libraries for auth and retry logic. |
| On-chain enforcement | Move from advisory to enforceable. |
Verified against mainnet
The oracle path has been tested end-to-end against live Chainlink feeds on Robinhood Chain. Stock Token prices, oraclePaused() state, and staleness windows have all been exercised against real mainnet data.
Independence
Collar Guardrail is an independent third-party application built to provide a risk layer for autonomous trading workflows.
It is not built, operated, sponsored, or endorsed by Robinhood.
Robinhood Chain is the underlying network referenced by the integration. COLR is a separate token used for access and tier gating.