agentsentinel-sdk 0.1.0__py3-none-any.whl
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.
- agent_sentinel/__init__.py +148 -0
- agent_sentinel/approval.py +683 -0
- agent_sentinel/compliance.py +332 -0
- agent_sentinel/cost.py +157 -0
- agent_sentinel/errors.py +269 -0
- agent_sentinel/guard.py +552 -0
- agent_sentinel/integrations/__init__.py +62 -0
- agent_sentinel/integrations/crewai.py +424 -0
- agent_sentinel/integrations/langchain.py +463 -0
- agent_sentinel/integrations/llm.py +573 -0
- agent_sentinel/integrations/pricing.py +237 -0
- agent_sentinel/intervention.py +262 -0
- agent_sentinel/ledger.py +224 -0
- agent_sentinel/mcp.py +631 -0
- agent_sentinel/policy.py +815 -0
- agent_sentinel/py.typed +0 -0
- agent_sentinel/replay.py +426 -0
- agent_sentinel/retry.py +288 -0
- agent_sentinel/sync.py +581 -0
- agentsentinel_sdk-0.1.0.dist-info/METADATA +650 -0
- agentsentinel_sdk-0.1.0.dist-info/RECORD +24 -0
- agentsentinel_sdk-0.1.0.dist-info/WHEEL +5 -0
- agentsentinel_sdk-0.1.0.dist-info/licenses/LICENSE +22 -0
- agentsentinel_sdk-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from .guard import guarded_action
|
|
4
|
+
from .errors import (
|
|
5
|
+
AgentSentinelError,
|
|
6
|
+
BudgetExceededError,
|
|
7
|
+
PolicyViolationError,
|
|
8
|
+
ReplayDivergenceError,
|
|
9
|
+
NetworkError,
|
|
10
|
+
SyncError,
|
|
11
|
+
TimeoutError,
|
|
12
|
+
ConfigurationError,
|
|
13
|
+
)
|
|
14
|
+
from .retry import (
|
|
15
|
+
RetryConfig,
|
|
16
|
+
CircuitBreaker,
|
|
17
|
+
with_retry,
|
|
18
|
+
with_circuit_breaker,
|
|
19
|
+
)
|
|
20
|
+
from .ledger import Ledger
|
|
21
|
+
from .cost import CostTracker
|
|
22
|
+
from .policy import PolicyEngine, PolicyConfig
|
|
23
|
+
from .sync import BackgroundSync, SyncConfig, enable_remote_sync, flush_and_stop
|
|
24
|
+
from .replay import ReplayMode, ReplayEntry, replay_mode
|
|
25
|
+
from .compliance import (
|
|
26
|
+
# Core classes
|
|
27
|
+
HumanApprovalHandler,
|
|
28
|
+
ComplianceMetadata,
|
|
29
|
+
ApprovalRequest as ComplianceApprovalRequest,
|
|
30
|
+
ApprovalResponse as ComplianceApprovalResponse,
|
|
31
|
+
# Enums
|
|
32
|
+
ApprovalStatus as ComplianceApprovalStatus,
|
|
33
|
+
ComplianceLevel,
|
|
34
|
+
# Utility functions
|
|
35
|
+
set_compliance_metadata,
|
|
36
|
+
get_compliance_metadata,
|
|
37
|
+
clear_compliance_metadata,
|
|
38
|
+
add_data_lineage,
|
|
39
|
+
set_decision_rationale,
|
|
40
|
+
set_model_card,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Approval Inbox (Flagship Feature)
|
|
44
|
+
from .approval import (
|
|
45
|
+
ApprovalClient,
|
|
46
|
+
ApprovalRequest,
|
|
47
|
+
ApprovalResponse,
|
|
48
|
+
ApprovalStatus,
|
|
49
|
+
ApprovalPriority,
|
|
50
|
+
RiskLevel,
|
|
51
|
+
ApprovalConfig,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# Interventions (CRITICAL - Core Value Proposition)
|
|
55
|
+
from .intervention import (
|
|
56
|
+
InterventionTracker,
|
|
57
|
+
InterventionRecord,
|
|
58
|
+
InterventionType,
|
|
59
|
+
InterventionOutcome,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
# MCP support (optional - requires httpx)
|
|
63
|
+
try:
|
|
64
|
+
from .mcp import (
|
|
65
|
+
MCPClient,
|
|
66
|
+
MCPTool,
|
|
67
|
+
MCPResource,
|
|
68
|
+
MCPPrompt,
|
|
69
|
+
MCPToolCallResult,
|
|
70
|
+
set_default_client,
|
|
71
|
+
get_default_client,
|
|
72
|
+
)
|
|
73
|
+
_MCP_AVAILABLE = True
|
|
74
|
+
except ImportError:
|
|
75
|
+
_MCP_AVAILABLE = False
|
|
76
|
+
MCPClient = None # type: ignore
|
|
77
|
+
MCPTool = None # type: ignore
|
|
78
|
+
MCPResource = None # type: ignore
|
|
79
|
+
MCPPrompt = None # type: ignore
|
|
80
|
+
MCPToolCallResult = None # type: ignore
|
|
81
|
+
set_default_client = None # type: ignore
|
|
82
|
+
get_default_client = None # type: ignore
|
|
83
|
+
|
|
84
|
+
# Framework integrations (optional - requires respective packages)
|
|
85
|
+
# Import integrations module to make it accessible
|
|
86
|
+
from . import integrations
|
|
87
|
+
|
|
88
|
+
__version__ = "0.1.0"
|
|
89
|
+
__all__ = [
|
|
90
|
+
"guarded_action",
|
|
91
|
+
"AgentSentinelError",
|
|
92
|
+
"BudgetExceededError",
|
|
93
|
+
"PolicyViolationError",
|
|
94
|
+
"ReplayDivergenceError",
|
|
95
|
+
"NetworkError",
|
|
96
|
+
"SyncError",
|
|
97
|
+
"TimeoutError",
|
|
98
|
+
"ConfigurationError",
|
|
99
|
+
"RetryConfig",
|
|
100
|
+
"CircuitBreaker",
|
|
101
|
+
"with_retry",
|
|
102
|
+
"with_circuit_breaker",
|
|
103
|
+
"Ledger",
|
|
104
|
+
"CostTracker",
|
|
105
|
+
"PolicyEngine",
|
|
106
|
+
"PolicyConfig",
|
|
107
|
+
"BackgroundSync",
|
|
108
|
+
"SyncConfig",
|
|
109
|
+
"enable_remote_sync",
|
|
110
|
+
"flush_and_stop",
|
|
111
|
+
"ReplayMode",
|
|
112
|
+
"ReplayEntry",
|
|
113
|
+
"replay_mode",
|
|
114
|
+
# EU Compliance (Enterprise Tier Foundation)
|
|
115
|
+
"HumanApprovalHandler",
|
|
116
|
+
"ComplianceMetadata",
|
|
117
|
+
"ComplianceApprovalRequest",
|
|
118
|
+
"ComplianceApprovalResponse",
|
|
119
|
+
"ComplianceApprovalStatus",
|
|
120
|
+
"ComplianceLevel",
|
|
121
|
+
"set_compliance_metadata",
|
|
122
|
+
"get_compliance_metadata",
|
|
123
|
+
"clear_compliance_metadata",
|
|
124
|
+
"add_data_lineage",
|
|
125
|
+
"set_decision_rationale",
|
|
126
|
+
"set_model_card",
|
|
127
|
+
# Approval Inbox (Flagship Feature)
|
|
128
|
+
"ApprovalClient",
|
|
129
|
+
"ApprovalRequest",
|
|
130
|
+
"ApprovalResponse",
|
|
131
|
+
"ApprovalStatus",
|
|
132
|
+
"ApprovalPriority",
|
|
133
|
+
"RiskLevel",
|
|
134
|
+
"ApprovalConfig",
|
|
135
|
+
# Interventions (CRITICAL - Core Value Proposition)
|
|
136
|
+
"InterventionTracker",
|
|
137
|
+
"InterventionRecord",
|
|
138
|
+
"InterventionType",
|
|
139
|
+
"InterventionOutcome",
|
|
140
|
+
# MCP Support (optional)
|
|
141
|
+
"MCPClient",
|
|
142
|
+
"MCPTool",
|
|
143
|
+
"MCPResource",
|
|
144
|
+
"MCPPrompt",
|
|
145
|
+
"MCPToolCallResult",
|
|
146
|
+
"set_default_client",
|
|
147
|
+
"get_default_client",
|
|
148
|
+
]
|