{
  "markdown": "# AgentRisk\n\n[![CI](https://github.com/trycoin-ai/agentrisk/actions/workflows/ci.yml/badge.svg)](https://github.com/trycoin-ai/agentrisk/actions/workflows/ci.yml)\n[![PyPI](https://img.shields.io/pypi/v/agentrisk.svg)](https://pypi.org/project/agentrisk/)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](pyproject.toml)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nRisk guardrails for AI trading agents. Your agent proposes; your policy decides.\n\n![AgentRisk in the terminal: create a risk policy, analyze portfolio exposure, and block an over-limit trade](docs/demo.gif)\n\nAgentRisk sits in front of trade execution: it analyzes portfolio risk, checks each\nproposed trade against a policy you write, and manages that policy. The core is\ndeterministic (same inputs, same verdict), transparent (policies are plain YAML you\ncan read and edit), and fail-closed (invalid input or a missing policy blocks, never\na silent pass).\n\n> AgentRisk never recommends trades and never executes them. A `PASS` means a trade\n> did not break the rules *you* wrote, not that it is safe or profitable. See\n> [DISCLAIMER.md](DISCLAIMER.md).\n\n## Quickstart\n\nThe fastest path for a Claude agent is the Claude Code plugin. It installs the Agent\nSkill and registers the [MCP](https://modelcontextprotocol.io) server in one step\n(via `uvx`, so there is nothing else to install):\n\n```text\n/plugin marketplace add trycoin-ai/agentrisk\n/plugin install agentrisk@agentrisk\n```\n\nFor any other MCP client, register the server yourself:\n\n```json\n{\n  \"mcpServers\": {\n    \"agentrisk\": {\n      \"command\": \"uvx\",\n      \"args\": [\"--from\", \"agentrisk[mcp]\", \"agentrisk-mcp\"]\n    }\n  }\n}\n```\n\nThen ask questions in plain English and the agent translates them into three tool\ncalls:\n\n| Tool | Question it answers | Returns |\n| --- | --- | --- |\n| `analyze_portfolio_risk` | What risk am I holding? | Concentration, exposure, and policy-compliance report |\n| `check_trade_risk` | Should this trade go through? | `PASS` / `WARN` / `BLOCK` with a one-line reason |\n| `generate_risk_policy` | What are my rules? | A human-readable YAML policy (create, update, show) |\n\nThe plugin path needs [uv](https://docs.astral.sh/uv/) for `uvx`. See\n[examples/claude_desktop.md](examples/claude_desktop.md) for a two-minute Claude\nDesktop setup.\n\n## Agent Skill\n\nFor Claude agents, AgentRisk ships an optional Agent Skill that encodes the\ndiscipline the guardrail depends on: before any order reaches a broker, classify the\ntrade, call `check_trade_risk`, respect the verdict, and record the result, in that\norder. The plugin above installs it with the server. To install just the skill:\n\n- **Claude Code or Claude Desktop:** copy `skills/agentrisk/` into `~/.claude/skills/`.\n- **claude.ai:** upload `skills/agentrisk/SKILL.md` as a skill.\n\n## The enforcement contract\n\nAgentRisk returns advice. It cannot physically stop an order, so your integration\nmust gate execution on the verdict:\n\n```python\nresult = check_trade_risk(portfolio, trade)\nif not result.proceed:\n    refuse(result.summary)              # BLOCK: never call the broker\nelif result.acknowledgements_required:\n    confirm_with_user(result)           # WARN: surface warnings first\nelse:\n    execute(trade)                      # PASS\n```\n\nIf you call the broker regardless of the verdict, you have a logger, not a guardrail.\nSee the [integration guide](docs/integration-guide.md).\n\n## Using the library directly\n\nThe three tools are also a pure Python library, with no network calls and no LLM in\nthe core:\n\n```bash\npip install agentrisk\n```\n\nEvery parameter, return field, and error case is in the\n[tool reference](docs/tool-reference.md).\n\n## What it checks\n\n- **Concentration caps** on single names, sectors, themes, and asset classes,\n  evaluated on the simulated post-trade portfolio.\n- **Asset-class rules** (allow, warn, or block) for crypto, options, and margin.\n- **Order sanity**: max order size, minimum cash floor, insufficient-funds detection.\n- **Restricted symbols** and **data quality** (stale snapshots warn, invalid ones\n  block).\n\nThe [policy reference](docs/policy-reference.md) covers every field and the safety\nbehaviors: fail closed, exits are never trapped, only breach-worsening trades block,\nand the one-time bypass.\n\n## Documentation\n\n| Doc | Contents |\n| --- | --- |\n| [Concepts](docs/concepts.md) | The mental model and the agent/AgentRisk division of labor |\n| [Architecture](docs/architecture.md) | The module layout and how a call flows through the core |\n| [Policy reference](docs/policy-reference.md) | Every policy field and the check behavior it drives |\n| [Tool reference](docs/tool-reference.md) | Parameters, outputs, and error cases for all three tools |\n| [CLI reference](docs/cli.md) | The `agentrisk` command: `policy`, `check`, `analyze` |\n| [Integration guide](docs/integration-guide.md) | The enforcement contract, broker MCP pairing, audit log |\n| [Threat model](docs/threat-model.md) | What AgentRisk can and cannot protect against |\n| [Classification data](docs/classification-data.md) | The open taxonomy and how to contribute corrections |\n\n## Roadmap\n\nNext is deterministic stress scenarios, ETF look-through, and behavioral limits\n(v0.2), then options analytics, broker snapshot adapters, short positions, and\nmulti-currency (v0.3). Trade recommendations, signals, execution, and telemetry are\npermanently out of scope. See the [milestones](https://github.com/trycoin-ai/agentrisk/milestones).\n\n## Contributing\n\nClassification-data corrections and new deterministic checks are especially welcome.\nSee [CONTRIBUTING.md](.github/CONTRIBUTING.md), and keep the core pure: no network,\nno LLM calls, no hidden state.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n\n<!-- mcp-name: io.github.trycoin-ai/agentrisk -->\n",
  "bytes": 5825,
  "sha": "17ecbef007e5c8e0a82ede87212431339f8fc0e2e51d582a42cab1ca27aed073",
  "repo_slug": "trycoin-ai/agentrisk",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_trycoin_ai_agentrisk_84f657de/readme"
}