Mantle Risk Evaluator
Overview
Run a mandatory pre-flight checklist and return a clear pass, warn, or block verdict. Prevent unsafe execution when any critical condition fails.
Workflow
- Normalize intent input:
- operation type
- token in/out and amount
- target protocol/router/pool addresses
- user risk parameters (slippage cap, deadline, max gas preference)
- Execute the checklist (see Checklist section below).
- Apply the threshold table (see Thresholds section below). Use user-specified parameters first; use defaults only when user constraints are absent.
- Classify each item:
- Produce final verdict:
pass: no fails, optional warns.
warn: no critical fails, but user confirmation required.
block: one or more critical fails.
Mandatory Input Fields
All of the following MUST be present in the intent. If any is missing, immediately set the final verdict to block with blocking reason "mandatory field missing":
operation_type
chain/environment
- token in/out and amount
- target contract/router/pool address
Checklist
1. Slippage check
- The "proposed slippage" is the slippage tolerance the user (or protocol) has set for this transaction.
- ALWAYS compare the proposed slippage against the default threshold table below, regardless of whether the user set it themselves.
- A user choosing a high slippage tolerance does NOT make it safe -- the default thresholds still apply.
- If the user also specifies a separate, stricter cap, apply whichever is more restrictive.
- Fail when proposed slippage exceeds the fail threshold (> 1.0% by default).
2. Liquidity depth check
- Estimate price impact from quote/simulation context.
- Warn on moderate impact, fail on severe impact (see thresholds).
- If liquidity data is unavailable, set warn with note "reduced confidence".
3. Address safety check
- Verify all addresses against trusted registry/tooling.
pass: trusted and verified source.
warn: unknown but not explicitly flagged.
fail: flagged, blacklisted, or malformed address.
4. Allowance scope check
- Detect approvals broader than required for intended amount.
pass: existing allowance fits intended spend scope.
warn: allowance materially larger than intended spend.
fail: new or existing near-unlimited approval without explicit user confirmation. Near-unlimited heuristic: raw allowance >= 2^255.
5. Gas and deadline sanity
- Check gas estimate reasonableness versus recent baseline.
- Check transaction deadline is not stale and not excessively long.
- Apply thresholds below.
Thresholds (defaults when user has not specified)
| Check |
Warn |
Fail |
| Slippage |
> 0.5% |
> 1.0% |
| Estimated price impact |
> 2% |
> 5% |
| Deadline horizon |
> 20 minutes |
> 60 minutes |
| Gas deviation from baseline |
> 20% |
> 40% |
Verdict Rules
- Any
fail in ANY checklist item => final verdict block.
- No
fail and at least one warn => final verdict warn.
- All checks
pass => final verdict pass.
Confidence policy
high: all required signals present and consistent.
medium: one non-critical signal missing.
low: key signals missing (e.g., no liquidity data or unresolved address provenance).
- If confidence is low, downgrade verdict one level toward caution (
pass -> warn, warn -> block).
Blocking Conditions
- Planned slippage exceeds user cap or exceeds 1.0% default.
- Address risk check fails (flagged, blacklisted, or malformed counterparty).
- Liquidity depth indicates severe price impact beyond 5%.
- Gas deviation from baseline exceeds 40%.
- Near-unlimited allowance (>= 2^255) without explicit user confirmation.
- Mandatory intent field is missing (cannot evaluate safely).
Output Format
Always use this exact structure. You MUST include ALL five checklist items in every response, even when blocking early due to missing fields. For checks that cannot be evaluated (e.g., because a required input is missing), mark them as fail with details explaining why (e.g., "cannot evaluate -- required field missing").
Mantle Preflight Risk Report
- operation:
- environment:
- evaluated_at_utc:
Checklist
- slippage_check: pass | warn | fail
details:
- liquidity_depth_check: pass | warn | fail
details:
- address_safety_check: pass | warn | fail
details:
- allowance_scope_check: pass | warn | fail
details:
- gas_and_deadline_check: pass | warn | fail
details:
Final Verdict
- status: pass | warn | block
- blocking_reasons:
- user_action_required:
References
references/risk-checklist.md
references/risk-threshold-guidance.md
1---
2name: mantle-risk-evaluator
3description: Use when a Mantle state-changing intent needs pre-execution slippage, liquidity, address-safety, allowance-scope, or gas/deadline checks.
4metadata:
5 source: https://skillmd.com/skills/starchild-ai-agent/mantle-risk-evaluator
6---
7
8# Mantle Risk Evaluator
9
10## Overview
11
12Run a mandatory pre-flight checklist and return a clear `pass`, `warn`, or `block` verdict. Prevent unsafe execution when any critical condition fails.
13
14## Workflow
15
161. Normalize intent input:
17 - operation type
18 - token in/out and amount
19 - target protocol/router/pool addresses
20 - user risk parameters (slippage cap, deadline, max gas preference)
212. Execute the checklist (see Checklist section below).
223. Apply the threshold table (see Thresholds section below). Use user-specified parameters first; use defaults only when user constraints are absent.
234. Classify each item:
24 - `pass`
25 - `warn`
26 - `fail`
275. Produce final verdict:
28 - `pass`: no fails, optional warns.
29 - `warn`: no critical fails, but user confirmation required.
30 - `block`: one or more critical fails.
31
32## Mandatory Input Fields
33
34All of the following MUST be present in the intent. If any is missing, immediately set the final verdict to `block` with blocking reason "mandatory field missing":
35
36- `operation_type`
37- `chain/environment`
38- token in/out and amount
39- target contract/router/pool address
40
41## Checklist
42
43### 1. Slippage check
44- The "proposed slippage" is the slippage tolerance the user (or protocol) has set for this transaction.
45- ALWAYS compare the proposed slippage against the default threshold table below, regardless of whether the user set it themselves.
46- A user choosing a high slippage tolerance does NOT make it safe -- the default thresholds still apply.
47- If the user also specifies a separate, stricter cap, apply whichever is more restrictive.
48- Fail when proposed slippage exceeds the fail threshold (> 1.0% by default).
49
50### 2. Liquidity depth check
51- Estimate price impact from quote/simulation context.
52- Warn on moderate impact, fail on severe impact (see thresholds).
53- If liquidity data is unavailable, set warn with note "reduced confidence".
54
55### 3. Address safety check
56- Verify all addresses against trusted registry/tooling.
57- `pass`: trusted and verified source.
58- `warn`: unknown but not explicitly flagged.
59- `fail`: flagged, blacklisted, or malformed address.
60
61### 4. Allowance scope check
62- Detect approvals broader than required for intended amount.
63- `pass`: existing allowance fits intended spend scope.
64- `warn`: allowance materially larger than intended spend.
65- `fail`: new or existing near-unlimited approval without explicit user confirmation. Near-unlimited heuristic: raw allowance `>= 2^255`.
66
67### 5. Gas and deadline sanity
68- Check gas estimate reasonableness versus recent baseline.
69- Check transaction deadline is not stale and not excessively long.
70- Apply thresholds below.
71
72## Thresholds (defaults when user has not specified)
73
74| Check | Warn | Fail |
75|---|---|---|
76| Slippage | > 0.5% | > 1.0% |
77| Estimated price impact | > 2% | > 5% |
78| Deadline horizon | > 20 minutes | > 60 minutes |
79| Gas deviation from baseline | > 20% | > 40% |
80
81## Verdict Rules
82
83- Any `fail` in ANY checklist item => final verdict **block**.
84- No `fail` and at least one `warn` => final verdict **warn**.
85- All checks `pass` => final verdict **pass**.
86
87### Confidence policy
88- `high`: all required signals present and consistent.
89- `medium`: one non-critical signal missing.
90- `low`: key signals missing (e.g., no liquidity data or unresolved address provenance).
91- If confidence is low, downgrade verdict one level toward caution (`pass` -> `warn`, `warn` -> `block`).
92
93## Blocking Conditions
94
95- Planned slippage exceeds user cap or exceeds 1.0% default.
96- Address risk check fails (flagged, blacklisted, or malformed counterparty).
97- Liquidity depth indicates severe price impact beyond 5%.
98- Gas deviation from baseline exceeds 40%.
99- Near-unlimited allowance (>= 2^255) without explicit user confirmation.
100- Mandatory intent field is missing (cannot evaluate safely).
101
102## Output Format
103
104Always use this exact structure. You MUST include ALL five checklist items in every response, even when blocking early due to missing fields. For checks that cannot be evaluated (e.g., because a required input is missing), mark them as `fail` with details explaining why (e.g., "cannot evaluate -- required field missing").
105
106```text
107Mantle Preflight Risk Report
108- operation:
109- environment:
110- evaluated_at_utc:
111
112Checklist
113- slippage_check: pass | warn | fail
114 details:
115- liquidity_depth_check: pass | warn | fail
116 details:
117- address_safety_check: pass | warn | fail
118 details:
119- allowance_scope_check: pass | warn | fail
120 details:
121- gas_and_deadline_check: pass | warn | fail
122 details:
123
124Final Verdict
125- status: pass | warn | block
126- blocking_reasons:
127- user_action_required:
128```
129
130## References
131
132- `references/risk-checklist.md`
133- `references/risk-threshold-guidance.md`