sanitise-exception-payloads-for-error-trackers
Use when an error tracker or crash reporter captures request context, cookies, or locals. Disable auto-capture, scrub in before_send, and prove it with a canary error.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- sanitise-exception-payloads-for-error-trackers
- description
- Use when an error tracker or crash reporter captures request context, cookies, or locals. Disable auto-capture, scrub in before_send, and prove it with a canary error.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md372 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Sanitise exception payloads for error trackers
Error trackers capture request context, cookies, and locals by default. This skill strips personal data before an exception ever leaves the process.
Procedure
-
Audit current capture in the SDK. For Sentry check
send_default_pii,max_request_body_size, and whetherbefore_sendis set. -
Turn off automatic PII capture at init:
Sentry.init(dsn=dsn, send_default_pii=False, max_request_body_size="never") -
Add a
before_sendhook that strips cookies, headers, and query strings:def before_send(event, hint): req = event.get("request", {}) req.pop("cookies", None); req.pop("headers", None) req["query_string"] = "" return event -
Scrub
extraandcontextsby allowlist; drop every key not on the safe list rather than trusting a denylist. -
Scrub breadcrumbs. Network breadcrumbs record URLs with query params; filter or disable them entirely.
-
Reduce the user object to an opaque id:
event["user"] = {"id": hash_id(user_id)}and nothing else. -
For frameworks (Rails, Django, Express) disable parameter capture in the tracker middleware explicitly, not just the SDK flag.
-
Test with a synthetic exception carrying a canary email in a header, a query string, and the body, then confirm the tracker event contains none of them.
-
Set server-side scrubbing rules in the tracker as a second layer, in case an older client still ships an unsanitised payload.
Pitfalls
- Upgrading the SDK can re-enable default capture; pin the version and re-run the canary after upgrades.
- Source-context capture sends surrounding source lines that may hold fixtures with real data.
- Attachments (screenshots, log files) bypass
before_send; disable attachment capture or scrub it separately. - Breadcrumbs survive on some SDKs even when
send_default_piiis off; verify empirically. - Sampling config may apply scrubbing only to sampled events; always scrub before sampling runs.
Verification
# post a synthetic error carrying CANARY-PII, then
curl -s -H "Authorization: Bearer $TRACKER_TOKEN" "$TRACKER_API/issues/$ID/events/latest" | grep -c "CANARY" # expect 0
Report which capture paths were disabled and the canary scan result for header, query, and body.
04 同仓库更多 Skills
troves
Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.
trade
Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".
staking
Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.
send
Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".
portfolio
View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".
multi-swap
Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.