{"skill":{"slug":"sardis-policy","displayName":"Sardis Policy","summary":"Natural language spending policy creation and management for Sardis agent wallets","description":"---\nname: sardis-policy\ndescription: Natural language spending policy creation and management for Sardis agent wallets\nversion: 1.0.0\nmetadata:\n  openclaw:\n    requires:\n      env:\n        - SARDIS_API_KEY\n      bins:\n        - curl\n        - jq\n    primaryEnv: SARDIS_API_KEY\n    emoji: \"🛡️\"\n    homepage: https://sardis.sh\n    install:\n      npm:\n        - \"@sardis/sdk\"\n    user-invocable: true\n    disable-model-invocation: false\n---\n\n# Sardis Policy - Natural Language Spending Controls\n\nCreate and manage spending policies for AI agents using natural language. Define limits, restrictions, and approval workflows without complex configuration.\n\n## Capabilities\n\n- **Natural Language Policies**: \"Max $500/day, only Amazon and OpenAI, no weekends\"\n- **Policy Templates**: Pre-built templates for common scenarios\n- **Policy Testing**: Dry-run transactions against policies without execution\n- **Multi-Layer Policies**: Combine transaction, daily, weekly, monthly limits\n- **Vendor Restrictions**: Allowlists, blocklists, category controls\n- **Time-Based Rules**: Weekend blocks, business hours only, time-of-day limits\n\n## Security Model\n\nPolicies are IMMUTABLE once created. To change a policy, create a new version and migrate the wallet.\n\n## Quick Setup\n\n```bash\nexport SARDIS_API_KEY=sk_your_key_here\n```\n\n## API Endpoint Patterns\n\nBase URL: `https://api.sardis.sh/v2`\n\n### Create Policy with Natural Language\n\n```bash\n# Create a new spending policy from natural language\ncurl -X POST https://api.sardis.sh/v2/policies \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Procurement Agent Policy\",\n    \"description\": \"Max $500/day, only Amazon and OpenAI, no weekends\",\n    \"wallet_id\": \"wallet_abc123\"\n  }'\n\n# The natural language in \"description\" is automatically parsed into rules\n```\n\n### Create Policy with Explicit Rules\n\n```bash\n# Create policy with structured rules\ncurl -X POST https://api.sardis.sh/v2/policies \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"SaaS Subscription Policy\",\n    \"wallet_id\": \"wallet_abc123\",\n    \"rules\": {\n      \"per_transaction_limit\": \"100.00\",\n      \"daily_limit\": \"500.00\",\n      \"weekly_limit\": \"2000.00\",\n      \"monthly_limit\": \"8000.00\",\n      \"allowed_vendors\": [\"openai.com\", \"anthropic.com\", \"github.com\"],\n      \"blocked_categories\": [\"gambling\", \"crypto-exchange\"],\n      \"time_restrictions\": {\n        \"allow_weekends\": false,\n        \"business_hours_only\": true,\n        \"timezone\": \"America/New_York\"\n      },\n      \"require_approval_above\": \"200.00\"\n    }\n  }'\n```\n\n### List Policies\n\n```bash\n# Get all policies for a wallet\ncurl -X GET https://api.sardis.sh/v2/wallets/{wallet_id}/policies \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\"\n```\n\n### Test Policy (Dry Run)\n\n```bash\n# Check if a transaction would be allowed WITHOUT executing it\ncurl -X POST https://api.sardis.sh/v2/policies/check \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"wallet_id\": \"wallet_abc123\",\n    \"amount\": \"75.00\",\n    \"vendor\": \"openai.com\",\n    \"token\": \"USDC\",\n    \"chain\": \"base\"\n  }'\n\n# Response:\n# {\n#   \"allowed\": true,\n#   \"reason\": \"Transaction approved\",\n#   \"remaining_daily\": \"425.00\",\n#   \"remaining_weekly\": \"1925.00\"\n# }\n```\n\n### Get Policy Details\n\n```bash\n# Get detailed policy rules\ncurl -X GET https://api.sardis.sh/v2/policies/{policy_id} \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\"\n```\n\n## Policy Templates\n\n### Template: Conservative Procurement\n\n```bash\ncurl -X POST https://api.sardis.sh/v2/policies/from-template \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"template\": \"conservative-procurement\",\n    \"wallet_id\": \"wallet_abc123\",\n    \"params\": {\n      \"daily_limit\": \"300.00\",\n      \"allowed_vendors\": [\"amazon.com\", \"walmart.com\"]\n    }\n  }'\n\n# Template rules:\n# - Low per-transaction limit ($50)\n# - Moderate daily limit (configurable)\n# - Vendor allowlist only\n# - Require approval above $100\n# - Business hours only\n```\n\n### Template: API Service Agent\n\n```bash\ncurl -X POST https://api.sardis.sh/v2/policies/from-template \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"template\": \"api-service-agent\",\n    \"wallet_id\": \"wallet_abc123\",\n    \"params\": {\n      \"daily_limit\": \"1000.00\",\n      \"allowed_vendors\": [\"openai.com\", \"anthropic.com\", \"stripe.com\"]\n    }\n  }'\n\n# Template rules:\n# - Higher per-transaction ($500)\n# - API vendor allowlist\n# - 24/7 allowed (services don't sleep)\n# - Auto-approve under $100\n```\n\n### Template: Restricted Trial\n\n```bash\ncurl -X POST https://api.sardis.sh/v2/policies/from-template \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"template\": \"restricted-trial\",\n    \"wallet_id\": \"wallet_abc123\",\n    \"params\": {\n      \"total_limit\": \"50.00\",\n      \"expires_at\": \"2026-03-21T00:00:00Z\"\n    }\n  }'\n\n# Template rules:\n# - Very low total limit\n# - Expires after period\n# - Require approval for all transactions\n# - Vendor allowlist only\n```\n\n### Template: Employee Card\n\n```bash\ncurl -X POST https://api.sardis.sh/v2/policies/from-template \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"template\": \"employee-card\",\n    \"wallet_id\": \"wallet_abc123\",\n    \"params\": {\n      \"daily_limit\": \"200.00\",\n      \"blocked_categories\": [\"gambling\", \"adult\", \"crypto-exchange\"]\n    }\n  }'\n\n# Template rules:\n# - Moderate limits\n# - Category blocklist\n# - Weekend spending allowed\n# - Detailed audit logging\n```\n\n## Example Commands\n\n### Create Simple Policy\n\n```bash\n# Quick policy creation with natural language\nWALLET_ID=wallet_abc123\n\ncurl -X POST https://api.sardis.sh/v2/policies \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Marketing Agent\",\n    \"description\": \"Max $100 per transaction, $500/day, only Google Ads and Meta\",\n    \"wallet_id\": \"'$WALLET_ID'\"\n  }'\n```\n\n### Test Before Payment\n\n```bash\n# Always test policy before executing payment\nWALLET_ID=wallet_abc123\nAMOUNT=75.00\nVENDOR=openai.com\n\nCHECK_RESULT=$(curl -s -X POST https://api.sardis.sh/v2/policies/check \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"wallet_id\": \"'$WALLET_ID'\",\n    \"amount\": \"'$AMOUNT'\",\n    \"vendor\": \"'$VENDOR'\"\n  }')\n\nif echo $CHECK_RESULT | jq -e '.allowed == true' > /dev/null; then\n  echo \"Payment would be approved\"\n  echo \"Remaining daily: $(echo $CHECK_RESULT | jq -r '.remaining_daily')\"\nelse\n  echo \"Payment would be BLOCKED\"\n  echo \"Reason: $(echo $CHECK_RESULT | jq -r '.reason')\"\nfi\n```\n\n### Batch Policy Testing\n\n```bash\n# Test multiple scenarios\nWALLET_ID=wallet_abc123\n\nTRANSACTIONS='[\n  {\"amount\": \"25.00\", \"vendor\": \"openai.com\"},\n  {\"amount\": \"150.00\", \"vendor\": \"amazon.com\"},\n  {\"amount\": \"500.00\", \"vendor\": \"stripe.com\"}\n]'\n\necho \"$TRANSACTIONS\" | jq -c '.[]' | while read tx; do\n  AMOUNT=$(echo $tx | jq -r '.amount')\n  VENDOR=$(echo $tx | jq -r '.vendor')\n\n  RESULT=$(curl -s -X POST https://api.sardis.sh/v2/policies/check \\\n    -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\n      \"wallet_id\": \"'$WALLET_ID'\",\n      \"amount\": \"'$AMOUNT'\",\n      \"vendor\": \"'$VENDOR'\"\n    }')\n\n  ALLOWED=$(echo $RESULT | jq -r '.allowed')\n  echo \"$AMOUNT to $VENDOR: $ALLOWED\"\ndone\n```\n\n### Update Policy (Create New Version)\n\n```bash\n# Policies are immutable, so create new version\nOLD_POLICY_ID=policy_abc123\nWALLET_ID=wallet_abc123\n\n# Create new policy\nNEW_POLICY=$(curl -s -X POST https://api.sardis.sh/v2/policies \\\n  -H \"Authorization: Bearer $SARDIS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Updated Procurement Policy\",\n    \"description\": \"Max $750/day, only Amazon OpenAI and Anthropic, no weekends\",\n    \"wallet_id\": \"'$WALLET_ID'\",\n    \"replaces\": \"'$OLD_POLICY_ID'\"\n  }')\n\necho \"New policy created: $(echo $NEW_POLICY | jq -r '.id')\"\n```\n\n## Response Examples\n\n### Policy Check Response (Allowed)\n\n```json\n{\n  \"allowed\": true,\n  \"reason\": \"Transaction approved within limits\",\n  \"policy_id\": \"policy_abc123\",\n  \"checks\": {\n    \"per_transaction_limit\": \"pass\",\n    \"daily_limit\": \"pass\",\n    \"vendor_allowlist\": \"pass\",\n    \"time_restriction\": \"pass\"\n  },\n  \"remaining\": {\n    \"daily\": \"425.00\",\n    \"weekly\": \"1925.00\",\n    \"monthly\": \"7425.00\"\n  }\n}\n```\n\n### Policy Check Response (Blocked)\n\n```json\n{\n  \"allowed\": false,\n  \"reason\": \"Daily spending limit exceeded\",\n  \"policy_id\": \"policy_abc123\",\n  \"checks\": {\n    \"per_transaction_limit\": \"pass\",\n    \"daily_limit\": \"fail\",\n    \"vendor_allowlist\": \"pass\"\n  },\n  \"details\": {\n    \"limit\": \"500.00\",\n    \"current_spend\": \"475.00\",\n    \"requested\": \"50.00\",\n    \"would_exceed_by\": \"25.00\"\n  }\n}\n```\n\n### Policy Details Response\n\n```json\n{\n  \"id\": \"policy_abc123\",\n  \"name\": \"SaaS Subscription Policy\",\n  \"wallet_id\": \"wallet_abc123\",\n  \"rules\": {\n    \"per_transaction_limit\": \"100.00\",\n    \"daily_limit\": \"500.00\",\n    \"weekly_limit\": \"2000.00\",\n    \"monthly_limit\": \"8000.00\",\n    \"allowed_vendors\": [\"openai.com\", \"anthropic.com\", \"github.com\"],\n    \"blocked_categories\": [\"gambling\", \"crypto-exchange\"],\n    \"time_restrictions\": {\n      \"allow_weekends\": false,\n      \"business_hours_only\": true,\n      \"business_hours\": \"09:00-17:00\",\n      \"timezone\": \"America/New_York\"\n    },\n    \"require_approval_above\": \"200.00\"\n  },\n  \"created_at\": \"2026-02-21T10:00:00Z\",\n  \"version\": 2\n}\n```\n\n## Natural Language Parser Examples\n\nThe policy description field supports these patterns:\n\n```\n\"Max $500/day, only Amazon and OpenAI\"\n→ daily_limit: 500, allowed_vendors: [amazon.com, openai.com]\n\n\"$100 per transaction, $1000/week, no weekends\"\n→ per_transaction_limit: 100, weekly_limit: 1000, allow_weekends: false\n\n\"Only verified merchants, require approval above $200\"\n→ verified_only: true, require_approval_above: 200\n\n\"Block gambling and crypto, business hours only\"\n→ blocked_categories: [gambling, crypto-exchange], business_hours_only: true\n\n\"Total budget $5000, expires March 1st\"\n→ total_limit: 5000, expires_at: 2026-03-01T00:00:00Z\n```\n\n## Available Templates\n\n| Template | Use Case | Key Features |\n|----------|----------|--------------|\n| `conservative-procurement` | Purchasing agent | Low limits, vendor allowlist, approval required |\n| `api-service-agent` | API/SaaS agent | Higher limits, 24/7, auto-approve |\n| `restricted-trial` | Trial/demo | Very low limits, expires |\n| `employee-card` | Employee spending | Moderate limits, category blocks |\n| `unrestricted` | Trusted agent | High limits, minimal restrictions |\n\n## Error Handling\n\n- `400 Bad Request` - Invalid policy syntax or conflicting rules\n- `401 Unauthorized` - Invalid API key\n- `403 Forbidden` - Cannot modify policy (immutable)\n- `404 Not Found` - Policy or wallet not found\n\n## Use Cases\n\n- **Agentic Procurement**: Safe purchasing with automatic guardrails\n- **API Service Agents**: Control cloud spending for LLM/SaaS\n- **Employee Cards**: Virtual cards with spending controls\n- **Trial Accounts**: Time-limited, low-budget wallets\n- **Multi-Tier Agents**: Different policies for different agent roles\n\n## Related Skills\n\n- `sardis-payment` - Execute payments with policy enforcement\n- `sardis-balance` - Monitor spending against policy limits\n- `sardis-cards` - Virtual cards with policy controls\n\n## Links\n\n- Website: https://sardis.sh\n- Documentation: https://sardis.sh/docs/policies\n- API Reference: https://api.sardis.sh/v2/docs\n- Support: support@sardis.sh\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":715,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1772972678660,"updatedAt":1779077785433},"latestVersion":{"version":"1.0.0","createdAt":1772972678660,"changelog":"- Initial release of the sardis-policy skill for Sardis agent wallets.\n- Enables natural language creation and management of spending policies.\n- Supports policy templates, explicit rule definition, and dry-run (test) policy checks.\n- Provides vendor allow/block lists, category controls, time-based limits, and multi-layer spending rules.\n- Policies are immutable; updates require creating a new version.\n- Includes detailed setup, usage commands, and API endpoint examples.","license":null},"metadata":{"setup":[{"key":"SARDIS_API_KEY","required":true}],"os":null,"systems":null},"owner":{"handle":"efedurmaz16","userId":"s173g6ctqbmcx214s55zqhxs2583mhvc","displayName":"EfeDurmaz16","image":"https://avatars.githubusercontent.com/u/75971010?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089805517}}