Sardis Guardrails - Real-Time Security Controls
Comprehensive security monitoring and emergency controls for agent wallets. Protect against runaway spending, anomalous behavior, and security threats with circuit breakers and kill switches.
Capabilities
- - Circuit Breaker Status: Check if automatic spending halts are active
- Kill Switch Control: Emergency stop all transactions wallet-wide
- Rate Limit Monitoring: Track transaction velocity and spending patterns
- Behavioral Alerts: Get warnings for anomalous agent behavior
- Emergency Controls: Immediate response to security threats
Security Model
CRITICAL CONTROLS: This skill can activate emergency stops that halt all wallet transactions. Use with caution.
Quick Setup
CODEBLOCK0
API Endpoint Patterns
Base URL: INLINECODE0
Check Circuit Breaker Status
CODEBLOCK1
Activate Kill Switch
CODEBLOCK2
Deactivate Kill Switch
CODEBLOCK3
Check Rate Limits
CODEBLOCK4
Get Behavioral Alerts
CODEBLOCK5
Example Commands
Emergency Stop Workflow
CODEBLOCK6
Rate Limit Monitor
CODEBLOCK7
Behavioral Alert Dashboard
CODEBLOCK8
Automated Circuit Breaker Response
CODEBLOCK9
Response Examples
Guardrails Status Response
CODEBLOCK10
Behavioral Alerts Response
CODEBLOCK11
Kill Switch Activation Response
CODEBLOCK12
Error Handling
- -
401 Unauthorized - Invalid or missing API key - INLINECODE2 - No access to this wallet or insufficient permissions
- INLINECODE3 - Wallet does not exist
- INLINECODE4 - Kill switch already in requested state
- INLINECODE5 - Rate limit exceeded
Use Cases
- - Security Incident Response: Emergency stop during security threats
- Anomaly Detection: Catch unusual spending patterns early
- Compliance Monitoring: Track transaction velocity for regulatory compliance
- Automated Safety: Circuit breakers prevent runaway spending
- Alert Automation: Integrate with monitoring systems for real-time alerts
Related Skills
- -
sardis-balance - Monitor wallet balances and spending - INLINECODE7 - Define spending rules and limits
- INLINECODE8 - Execute controlled payments
Links
- - Website: https://sardis.sh
- Documentation: https://sardis.sh/docs/guardrails
- API Reference: https://api.sardis.sh/v2/docs
- Security: https://sardis.sh/security
- Support: support@sardis.sh
Sardis Guardrails - 实时安全控制
为代理钱包提供全面的安全监控和紧急控制。通过断路器和紧急开关,防范失控支出、异常行为和安全威胁。
功能
- - 断路器状态:检查自动暂停支出功能是否启用
- 紧急开关控制:紧急停止钱包范围内的所有交易
- 速率限制监控:追踪交易速度和支出模式
- 行为告警:获取代理异常行为的警告
- 紧急控制:对安全威胁做出即时响应
安全模型
关键控制:此技能可激活紧急停止功能,暂停所有钱包交易。请谨慎使用。
快速设置
bash
export SARDISAPIKEY=skyourkey_here
API 端点模式
基础 URL:https://api.sardis.sh/v2
检查断路器状态
bash
获取当前断路器和紧急开关状态
curl -X GET https://api.sardis.sh/v2/guardrails/status \
-H Authorization: Bearer $SARDIS
APIKEY \
-H X-Wallet-ID: wallet_abc123
示例响应:
{
walletid: walletabc123,
circuit_breaker: {
active: false,
reason: null,
triggered_at: null
},
kill_switch: {
active: false,
activated_by: null,
activated_at: null
},
rate_limits: {
txperminute: 5,
current_rate: 2.3,
threshold_breached: false
},
status: operational
}
激活紧急开关
bash
紧急停止钱包的所有交易
curl -X POST https://api.sardis.sh/v2/guardrails/kill-switch/activate \
-H Authorization: Bearer $SARDIS
APIKEY \
-H Content-Type: application/json \
-d {
wallet
id: walletabc123,
reason: 检测到疑似未授权活动
}
响应:
{
walletid: walletabc123,
killswitchactive: true,
activated_at: 2026-02-21T10:30:00Z,
reason: 检测到疑似未授权活动,
message: 所有交易已暂停。请联系支持团队重新激活。
}
停用紧急开关
bash
调查后恢复正常操作
curl -X POST https://api.sardis.sh/v2/guardrails/kill-switch/deactivate \
-H Authorization: Bearer $SARDIS
APIKEY \
-H Content-Type: application/json \
-d {
wallet
id: walletabc123
}
响应:
{
walletid: walletabc123,
killswitchactive: false,
deactivated_at: 2026-02-21T11:00:00Z,
message: 钱包已恢复运行。交易已恢复。
}
检查速率限制
bash
监控交易速度和支出率
curl -X GET https://api.sardis.sh/v2/guardrails/rate-limits \
-H Authorization: Bearer $SARDIS
APIKEY \
-H X-Wallet-ID: wallet_abc123
示例响应:
{
walletid: walletabc123,
limits: {
txperminute: {
limit: 5,
current: 2.3,
percentage_used: 46.0,
breached: false
},
txperhour: {
limit: 100,
current: 45,
percentage_used: 45.0,
breached: false
},
spendperhour_usd: {
limit: 1000.00,
current: 325.50,
percentage_used: 32.55,
breached: false
}
},
status: healthy
}
获取行为告警
bash
检索异常检测告警
curl -X GET https://api.sardis.sh/v2/guardrails/alerts \
-H Authorization: Bearer $SARDIS
APIKEY \
-H X-Wallet-ID: wallet_abc123
过滤器:
- severity: low, medium, high, critical
- limit: 告警数量(默认20,最多100)
- since: ISO 8601 时间戳,获取此时间后的告警
带过滤器的示例:
curl -X GET https://api.sardis.sh/v2/guardrails/alerts?severity=high&limit=10 \
-H Authorization: Bearer $SARDIS
APIKEY \
-H X-Wallet-ID: wallet_abc123
示例命令
紧急停止工作流
bash
1. 检查当前状态
WALLET
ID=walletabc123
STATUS=$(curl -s -X GET https://api.sardis.sh/v2/guardrails/status \
-H Authorization: Bearer $SARDIS
APIKEY \
-H X-Wallet-ID: $WALLET_ID)
echo 当前状态:
echo $STATUS | jq .
2. 如有需要,激活紧急开关
if [[ $(echo $STATUS | jq -r .circuit_breaker.active) == true ]]; then
echo 断路器已激活!
curl -X POST https://api.sardis.sh/v2/guardrails/kill-switch/activate \
-H Authorization: Bearer $SARDISAPIKEY \
-H Content-Type: application/json \
-d {\walletid\: \$WALLETID\, \reason\: \手动紧急停止\}
fi
速率限制监控器
bash
监控并告警高交易率
WALLET
ID=walletabc123
while true; do
LIMITS=$(curl -s -X GET https://api.sardis.sh/v2/guardrails/rate-limits \
-H Authorization: Bearer $SARDISAPIKEY \
-H X-Wallet-ID: $WALLET_ID)
TXRATE=$(echo $LIMITS | jq -r .limits.txper_minute.current)
THRESHOLD=80
USAGE=$(echo $LIMITS | jq -r .limits.txperminute.percentage_used)
if (( $(echo $USAGE > $THRESHOLD | bc -l) )); then
echo 警告:交易率已达限制的 ${USAGE}%
echo 当前:$TX_RATE 笔/分钟
fi
sleep 30
done
行为告警仪表盘
bash
获取关键告警并显示摘要
WALLET
ID=walletabc123
echo === 关键安全告警 ===
curl -s -X GET https://api.sardis.sh/v2/guardrails/alerts?severity=critical&limit=5 \
-H Authorization: Bearer $SARDISAPIKEY \
-H X-Wallet-ID: $WALLET_ID | jq .alerts[] | \(.timestamp) - \(.type): \(.message)
echo -e \n=== 高优先级告警 ===
curl -s -X GET https://api.sardis.sh/v2/guardrails/alerts?severity=high&limit=5 \
-H Authorization: Bearer $SARDISAPIKEY \
-H X-Wallet-ID: $WALLET_ID | jq .alerts[] | \(.timestamp) - \(.type): \(.message)
自动断路器响应
bash
检查断路器激活状态并通知
WALLET
ID=walletabc123
STATUS=$(curl -s -X GET https://api.sardis.sh/v2/guardrails/status \
-H Authorization: Bearer $SARDISAPIKEY \
-H X-Wallet-ID: $WALLET_ID)
if [[ $(echo $STATUS | jq -r .circuit_breaker.active) == true ]]; then
REASON=$(echo $STATUS | jq -r .circuit_breaker.reason)
echo 告