agentsentinel-sdk 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. agentsentinel_sdk-0.1.0/CHANGELOG.md +116 -0
  2. agentsentinel_sdk-0.1.0/LICENSE +22 -0
  3. agentsentinel_sdk-0.1.0/MANIFEST.in +11 -0
  4. agentsentinel_sdk-0.1.0/PKG-INFO +650 -0
  5. agentsentinel_sdk-0.1.0/README.md +590 -0
  6. agentsentinel_sdk-0.1.0/agent_sentinel/__init__.py +148 -0
  7. agentsentinel_sdk-0.1.0/agent_sentinel/approval.py +683 -0
  8. agentsentinel_sdk-0.1.0/agent_sentinel/compliance.py +332 -0
  9. agentsentinel_sdk-0.1.0/agent_sentinel/cost.py +157 -0
  10. agentsentinel_sdk-0.1.0/agent_sentinel/errors.py +269 -0
  11. agentsentinel_sdk-0.1.0/agent_sentinel/guard.py +552 -0
  12. agentsentinel_sdk-0.1.0/agent_sentinel/integrations/__init__.py +62 -0
  13. agentsentinel_sdk-0.1.0/agent_sentinel/integrations/crewai.py +424 -0
  14. agentsentinel_sdk-0.1.0/agent_sentinel/integrations/langchain.py +463 -0
  15. agentsentinel_sdk-0.1.0/agent_sentinel/integrations/llm.py +573 -0
  16. agentsentinel_sdk-0.1.0/agent_sentinel/integrations/pricing.py +237 -0
  17. agentsentinel_sdk-0.1.0/agent_sentinel/intervention.py +262 -0
  18. agentsentinel_sdk-0.1.0/agent_sentinel/ledger.py +224 -0
  19. agentsentinel_sdk-0.1.0/agent_sentinel/mcp.py +631 -0
  20. agentsentinel_sdk-0.1.0/agent_sentinel/policy.py +815 -0
  21. agentsentinel_sdk-0.1.0/agent_sentinel/py.typed +0 -0
  22. agentsentinel_sdk-0.1.0/agent_sentinel/replay.py +426 -0
  23. agentsentinel_sdk-0.1.0/agent_sentinel/retry.py +288 -0
  24. agentsentinel_sdk-0.1.0/agent_sentinel/sync.py +581 -0
  25. agentsentinel_sdk-0.1.0/agentsentinel_sdk.egg-info/PKG-INFO +650 -0
  26. agentsentinel_sdk-0.1.0/agentsentinel_sdk.egg-info/SOURCES.txt +41 -0
  27. agentsentinel_sdk-0.1.0/agentsentinel_sdk.egg-info/dependency_links.txt +1 -0
  28. agentsentinel_sdk-0.1.0/agentsentinel_sdk.egg-info/requires.txt +42 -0
  29. agentsentinel_sdk-0.1.0/agentsentinel_sdk.egg-info/top_level.txt +1 -0
  30. agentsentinel_sdk-0.1.0/pyproject.toml +154 -0
  31. agentsentinel_sdk-0.1.0/setup.cfg +4 -0
  32. agentsentinel_sdk-0.1.0/tests/__init__.py +3 -0
  33. agentsentinel_sdk-0.1.0/tests/test_approval_mcp_coverage.py +313 -0
  34. agentsentinel_sdk-0.1.0/tests/test_guard_coverage.py +436 -0
  35. agentsentinel_sdk-0.1.0/tests/test_init_errors_coverage.py +294 -0
  36. agentsentinel_sdk-0.1.0/tests/test_integrations_coverage.py +253 -0
  37. agentsentinel_sdk-0.1.0/tests/test_ledger_coverage.py +442 -0
  38. agentsentinel_sdk-0.1.0/tests/test_mcp_integration_simple.py +106 -0
  39. agentsentinel_sdk-0.1.0/tests/test_policy_coverage.py +468 -0
  40. agentsentinel_sdk-0.1.0/tests/test_policy_remote.py +713 -0
  41. agentsentinel_sdk-0.1.0/tests/test_replay.py +761 -0
  42. agentsentinel_sdk-0.1.0/tests/test_retry_compliance_coverage.py +417 -0
  43. agentsentinel_sdk-0.1.0/tests/test_sync.py +531 -0
@@ -0,0 +1,116 @@
1
+ # Changelog
2
+
3
+ All notable changes to AgentSentinel SDK will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2025-01-15
9
+
10
+ ### Initial Release
11
+
12
+ **AgentSentinel is the operational circuit breaker for autonomous agents.**
13
+
14
+ This SDK provides runtime authority and control over autonomous AI agents, enabling developers and organizations to actively manage the financial, logical, and compliance risks of agents in production.
15
+
16
+ > **Core Value:** AgentSentinel exists to decide whether an autonomous system is allowed to act — before it does.
17
+
18
+ #### The Three Pillars
19
+
20
+ **1. Active Safety 🛡️**
21
+ Runtime enforcement that overrides agent intent. Every check happens BEFORE execution.
22
+
23
+ - `@guarded_action` decorator for action instrumentation
24
+ - Budget enforcement (session, run, and action-level hard caps)
25
+ - Action bans (deny list prevents execution of forbidden actions)
26
+ - Action allowlists (restrict agents to approved actions only)
27
+ - Rate limiting (time-windowed execution limits)
28
+ - Fail-open design (agents never fail-open without explicit authorization)
29
+ - High-precision time tracking (nanosecond resolution)
30
+
31
+ **2. Governance 📋**
32
+ Complete authority over what happened, when, and why.
33
+
34
+ - Immutable execution ledger (`.agent-sentinel/ledger.jsonl`)
35
+ - Cost tracking with per-action, per-run, per-session attribution
36
+ - Human-in-the-loop approval workflow
37
+ - Decision rationale logging
38
+ - Data lineage tracking
39
+ - Replay mode for deterministic testing
40
+ - Input divergence detection
41
+ - EU AI Act Article 14 compliance metadata
42
+
43
+ **3. Operations ⚙️**
44
+ The bridge between autonomous agents and human authority.
45
+
46
+ - Policy engine with YAML configuration (`callguard.yaml`)
47
+ - Remote policy synchronization from platform
48
+ - Background sync with batch uploads and retry logic
49
+ - Intervention tracking (records when Sentinel blocks actions)
50
+ - Approval client for managing approval requests
51
+ - Interruptible execution with resumable authority
52
+
53
+ #### Integrations
54
+
55
+ **LLM Providers**
56
+ - OpenAI with automatic cost tracking
57
+ - Anthropic Claude
58
+ - xAI/Grok
59
+ - Google Gemini
60
+ - Token-based cost calculation with pricing database
61
+
62
+ **AI Frameworks**
63
+ - LangChain callback handler for chain/agent tracing
64
+ - CrewAI integration for crew and task monitoring
65
+ - MCP (Model Context Protocol) client support
66
+
67
+ **Error Handling & Resilience**
68
+ - Structured exception hierarchy
69
+ - `with_retry` decorator with exponential backoff
70
+ - `CircuitBreaker` for fault tolerance
71
+ - Comprehensive error types: `BudgetExceededError`, `PolicyViolationError`, `ReplayDivergenceError`, `NetworkError`, `SyncError`, `TimeoutError`, `ConfigurationError`
72
+
73
+ #### Installation
74
+
75
+ ```bash
76
+ # Basic installation
77
+ pip install agentsentinel-sdk
78
+
79
+ # With remote sync
80
+ pip install agentsentinel-sdk[remote]
81
+
82
+ # With LLM integrations
83
+ pip install agentsentinel-sdk[llm]
84
+
85
+ # With framework integrations
86
+ pip install agentsentinel-sdk[integrations]
87
+
88
+ # With everything
89
+ pip install agentsentinel-sdk[all]
90
+ ```
91
+
92
+ #### Technical Highlights
93
+
94
+ - **Python 3.9+** support
95
+ - **Type-safe** with full type hints and `py.typed` marker
96
+ - **Minimal dependencies** (pydantic + pyyaml for core)
97
+ - **Local-first** architecture (works completely offline)
98
+ - **Async/sync** support throughout
99
+ - **Production-ready** with comprehensive test suite (4,737 lines)
100
+ - **MIT License**
101
+
102
+ #### Strategic Positioning
103
+
104
+ AgentSentinel is not:
105
+ - A logging tool (that's a camera)
106
+ - An analytics dashboard (that's a report)
107
+ - An observability platform (that's hindsight)
108
+
109
+ AgentSentinel is:
110
+ - The brakes on the car
111
+ - The circuit breaker in the system
112
+ - The authorization layer between intent and action
113
+
114
+ > "Commoditize observability. Monetize control."
115
+
116
+ [0.1.0]: https://github.com/agent-sentinel/agent-sentinel-sdk/releases/tag/v0.1.0
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Agent Sentinel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,11 @@
1
+ include LICENSE
2
+ include README.md
3
+ include CHANGELOG.md
4
+ include pyproject.toml
5
+ recursive-include agent_sentinel *.py
6
+ recursive-include agent_sentinel *.typed
7
+ recursive-include tests *.py
8
+ exclude agent_sentinel.egg-info/*
9
+ global-exclude __pycache__
10
+ global-exclude *.py[co]
11
+ global-exclude .DS_Store