agent-authorizer 0.14.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_authorizer/__init__.py +123 -0
- agent_authorizer/__main__.py +5 -0
- agent_authorizer/_api.py +606 -0
- agent_authorizer/_audit.py +76 -0
- agent_authorizer/_checks.py +258 -0
- agent_authorizer/_context.py +178 -0
- agent_authorizer/_default.py +39 -0
- agent_authorizer/_entitlements.py +344 -0
- agent_authorizer/_fence.py +161 -0
- agent_authorizer/_gateway.py +146 -0
- agent_authorizer/_mcp_endpoint.py +386 -0
- agent_authorizer/_page/__init__.py +17 -0
- agent_authorizer/_page/index.html +55 -0
- agent_authorizer/_page/watch.css +277 -0
- agent_authorizer/_page/watch.js +531 -0
- agent_authorizer/_permissions.py +63 -0
- agent_authorizer/_record.py +167 -0
- agent_authorizer/_rules.py +224 -0
- agent_authorizer/_runs.py +91 -0
- agent_authorizer/_session.py +311 -0
- agent_authorizer/_toolkit.py +1003 -0
- agent_authorizer/_untrusted.py +77 -0
- agent_authorizer/_version.py +1 -0
- agent_authorizer/_walk.py +48 -0
- agent_authorizer/_watch.py +290 -0
- agent_authorizer/_wire.py +557 -0
- agent_authorizer/authx/__init__.py +6 -0
- agent_authorizer/authx/awscreds.py +295 -0
- agent_authorizer/authx/awsquery.py +252 -0
- agent_authorizer/authx/google.py +89 -0
- agent_authorizer/authx/jwt.py +359 -0
- agent_authorizer/authx/oauth2.py +180 -0
- agent_authorizer/authx/sigv4.py +290 -0
- agent_authorizer/authx/sts.py +177 -0
- agent_authorizer/authx/token.py +137 -0
- agent_authorizer/authx/util.py +446 -0
- agent_authorizer/authx/xmlutil.py +92 -0
- agent_authorizer/claude_agent_sdk.py +187 -0
- agent_authorizer/cli.py +698 -0
- agent_authorizer/core/__init__.py +0 -0
- agent_authorizer/core/cache.py +413 -0
- agent_authorizer/core/catalog.py +237 -0
- agent_authorizer/core/config.py +705 -0
- agent_authorizer/core/context.py +233 -0
- agent_authorizer/core/decision.py +210 -0
- agent_authorizer/core/declog.py +113 -0
- agent_authorizer/core/duration.py +144 -0
- agent_authorizer/core/engine.py +460 -0
- agent_authorizer/core/errors.py +185 -0
- agent_authorizer/core/evidence.py +324 -0
- agent_authorizer/core/integration.py +585 -0
- agent_authorizer/core/jsonx.py +135 -0
- agent_authorizer/core/log.py +188 -0
- agent_authorizer/core/oidc.py +297 -0
- agent_authorizer/core/routes.py +601 -0
- agent_authorizer/core/secret.py +146 -0
- agent_authorizer/core/template.py +126 -0
- agent_authorizer/crewai.py +208 -0
- agent_authorizer/google_adk.py +229 -0
- agent_authorizer/integrations/__init__.py +47 -0
- agent_authorizer/integrations/_googleapis.py +257 -0
- agent_authorizer/integrations/argocd/__init__.py +399 -0
- agent_authorizer/integrations/argocd/actions.py +186 -0
- agent_authorizer/integrations/argocd/rbac/__init__.py +452 -0
- agent_authorizer/integrations/argocd/rbac/builtin.py +69 -0
- agent_authorizer/integrations/argocd/rbac/glob.py +213 -0
- agent_authorizer/integrations/argocd/rbac/re2.py +595 -0
- agent_authorizer/integrations/argocd/routes.py +564 -0
- agent_authorizer/integrations/aws/__init__.py +9 -0
- agent_authorizer/integrations/aws/actions.py +138 -0
- agent_authorizer/integrations/aws/aws.py +786 -0
- agent_authorizer/integrations/aws/eks.py +164 -0
- agent_authorizer/integrations/aws/identity.py +490 -0
- agent_authorizer/integrations/aws/routes.py +1421 -0
- agent_authorizer/integrations/azure/__init__.py +9 -0
- agent_authorizer/integrations/azure/actions.py +230 -0
- agent_authorizer/integrations/azure/azure.py +741 -0
- agent_authorizer/integrations/azure/routes.py +339 -0
- agent_authorizer/integrations/bitbucket/__init__.py +168 -0
- agent_authorizer/integrations/bitbucket/actions.py +259 -0
- agent_authorizer/integrations/bitbucket/cloud.py +429 -0
- agent_authorizer/integrations/bitbucket/common.py +108 -0
- agent_authorizer/integrations/bitbucket/datacenter.py +469 -0
- agent_authorizer/integrations/bitbucket/routes.py +557 -0
- agent_authorizer/integrations/confluence/__init__.py +11 -0
- agent_authorizer/integrations/confluence/actions.py +97 -0
- agent_authorizer/integrations/confluence/confluence.py +413 -0
- agent_authorizer/integrations/confluence/routes.py +314 -0
- agent_authorizer/integrations/databricks/__init__.py +9 -0
- agent_authorizer/integrations/databricks/actions.py +417 -0
- agent_authorizer/integrations/databricks/databricks.py +657 -0
- agent_authorizer/integrations/databricks/routes.py +525 -0
- agent_authorizer/integrations/datadog/__init__.py +9 -0
- agent_authorizer/integrations/datadog/actions.py +167 -0
- agent_authorizer/integrations/datadog/datadog.py +471 -0
- agent_authorizer/integrations/datadog/routes.py +664 -0
- agent_authorizer/integrations/fake.py +155 -0
- agent_authorizer/integrations/github/__init__.py +10 -0
- agent_authorizer/integrations/github/actions.py +210 -0
- agent_authorizer/integrations/github/github.py +1133 -0
- agent_authorizer/integrations/github/identity.py +553 -0
- agent_authorizer/integrations/github/routes.py +477 -0
- agent_authorizer/integrations/gitlab/__init__.py +925 -0
- agent_authorizer/integrations/gitlab/actions.py +222 -0
- agent_authorizer/integrations/gitlab/routes.py +700 -0
- agent_authorizer/integrations/googlecloud/__init__.py +10 -0
- agent_authorizer/integrations/googlecloud/actions.py +307 -0
- agent_authorizer/integrations/googlecloud/googlecloud.py +533 -0
- agent_authorizer/integrations/googlecloud/routes.py +1018 -0
- agent_authorizer/integrations/googleworkspace/__init__.py +10 -0
- agent_authorizer/integrations/googleworkspace/actions.py +83 -0
- agent_authorizer/integrations/googleworkspace/googleworkspace.py +880 -0
- agent_authorizer/integrations/googleworkspace/routes.py +654 -0
- agent_authorizer/integrations/jira/__init__.py +27 -0
- agent_authorizer/integrations/jira/actions.py +114 -0
- agent_authorizer/integrations/jira/jira.py +454 -0
- agent_authorizer/integrations/jira/routes.py +169 -0
- agent_authorizer/integrations/jira/site.py +219 -0
- agent_authorizer/integrations/kubernetes/__init__.py +503 -0
- agent_authorizer/integrations/kubernetes/actions.py +197 -0
- agent_authorizer/integrations/kubernetes/routes.py +127 -0
- agent_authorizer/integrations/linear/__init__.py +10 -0
- agent_authorizer/integrations/linear/actions.py +115 -0
- agent_authorizer/integrations/linear/linear.py +663 -0
- agent_authorizer/integrations/linear/routes.py +282 -0
- agent_authorizer/integrations/microsoft365/__init__.py +10 -0
- agent_authorizer/integrations/microsoft365/actions.py +136 -0
- agent_authorizer/integrations/microsoft365/microsoft365.py +1034 -0
- agent_authorizer/integrations/microsoft365/routes.py +866 -0
- agent_authorizer/integrations/okta/__init__.py +10 -0
- agent_authorizer/integrations/okta/okta.py +210 -0
- agent_authorizer/integrations/okta/routes.py +31 -0
- agent_authorizer/integrations/pagerduty/__init__.py +9 -0
- agent_authorizer/integrations/pagerduty/actions.py +140 -0
- agent_authorizer/integrations/pagerduty/pagerduty.py +440 -0
- agent_authorizer/integrations/pagerduty/routes.py +636 -0
- agent_authorizer/integrations/salesforce/__init__.py +13 -0
- agent_authorizer/integrations/salesforce/actions.py +158 -0
- agent_authorizer/integrations/salesforce/routes.py +405 -0
- agent_authorizer/integrations/salesforce/salesforce.py +1310 -0
- agent_authorizer/integrations/salesforce/soql.py +493 -0
- agent_authorizer/integrations/slack/__init__.py +10 -0
- agent_authorizer/integrations/slack/actions.py +84 -0
- agent_authorizer/integrations/slack/routes.py +269 -0
- agent_authorizer/integrations/slack/slack.py +967 -0
- agent_authorizer/integrations/snowflake/__init__.py +12 -0
- agent_authorizer/integrations/snowflake/actions.py +172 -0
- agent_authorizer/integrations/snowflake/routes.py +637 -0
- agent_authorizer/integrations/snowflake/snowflake.py +685 -0
- agent_authorizer/integrations/snowflake/sql.py +101 -0
- agent_authorizer/integrations/vault/__init__.py +9 -0
- agent_authorizer/integrations/vault/actions.py +157 -0
- agent_authorizer/integrations/vault/policy.py +817 -0
- agent_authorizer/integrations/vault/routes.py +374 -0
- agent_authorizer/integrations/vault/vault.py +834 -0
- agent_authorizer/integrations/zendesk/__init__.py +9 -0
- agent_authorizer/integrations/zendesk/actions.py +90 -0
- agent_authorizer/integrations/zendesk/routes.py +470 -0
- agent_authorizer/integrations/zendesk/zendesk.py +798 -0
- agent_authorizer/langchain.py +237 -0
- agent_authorizer/llamaindex.py +186 -0
- agent_authorizer/mcp.py +99 -0
- agent_authorizer/net/__init__.py +0 -0
- agent_authorizer/net/httpx.py +1404 -0
- agent_authorizer/openai_agents.py +198 -0
- agent_authorizer/otel.py +93 -0
- agent_authorizer/py.typed +0 -0
- agent_authorizer/pydantic_ai.py +202 -0
- agent_authorizer/server.py +664 -0
- agent_authorizer/strands.py +148 -0
- agent_authorizer-0.14.0.dist-info/METADATA +575 -0
- agent_authorizer-0.14.0.dist-info/RECORD +175 -0
- agent_authorizer-0.14.0.dist-info/WHEEL +4 -0
- agent_authorizer-0.14.0.dist-info/entry_points.txt +2 -0
- agent_authorizer-0.14.0.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""agent-authorizer: authorizes what an AI agent does against the permissions of the user it acts for.
|
|
2
|
+
|
|
3
|
+
import agent_authorizer
|
|
4
|
+
from agent_authorizer import Session, AgentAuthorizer, permission_check
|
|
5
|
+
|
|
6
|
+
tp = AgentAuthorizer.from_config("agent-authorizer.yaml") # permission checks, live
|
|
7
|
+
agent_authorizer.configure(credentials={"github-bot": token})
|
|
8
|
+
|
|
9
|
+
@agent_authorizer.tool(effect="write", scope={"repo": "acme/gitops-*"}, credential="github-bot",
|
|
10
|
+
authorize=permission_check(tp, "github-acme", "pr.create", "repo:{repo}"))
|
|
11
|
+
def open_pr(repo: str, title: str, *, credential: str) -> str: ...
|
|
12
|
+
|
|
13
|
+
with Session("dana@example.com").active():
|
|
14
|
+
agent.run(prompt)
|
|
15
|
+
|
|
16
|
+
``tool`` declares a tool and runs the checks around every call;
|
|
17
|
+
``Toolkit`` holds a separate set of settings when one program needs two.
|
|
18
|
+
``AgentAuthorizer`` answers "may this user do this?" by asking the system that owns
|
|
19
|
+
the resource, in-process or against an agent-authorizer server; ``guarded`` and the
|
|
20
|
+
framework adapters use it on their own.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from agent_authorizer._api import (
|
|
24
|
+
ALLOW,
|
|
25
|
+
DENY,
|
|
26
|
+
UNKNOWN,
|
|
27
|
+
AgentAuthorizer,
|
|
28
|
+
Decision,
|
|
29
|
+
GroupsSource,
|
|
30
|
+
PermissionDenied,
|
|
31
|
+
UserSource,
|
|
32
|
+
current,
|
|
33
|
+
guarded,
|
|
34
|
+
)
|
|
35
|
+
from agent_authorizer._audit import AuditEvent, AuditSink, log_audit
|
|
36
|
+
from agent_authorizer._checks import ScopeRule, Validator
|
|
37
|
+
from agent_authorizer._context import ObservedAction, as_agent, as_user, current_call
|
|
38
|
+
from agent_authorizer._default import configure, default_toolkit, secured_tool, tool
|
|
39
|
+
from agent_authorizer._entitlements import ActionRecorder, Entitlement, Entitlements, ToolEntitlements
|
|
40
|
+
from agent_authorizer._fence import FENCE_END, FENCE_START, Fenced, fence, neutralize
|
|
41
|
+
from agent_authorizer._permissions import permission_check
|
|
42
|
+
from agent_authorizer._session import GROUPS_HEADER, KEY_HEADER, SESSION_HEADER, TOKEN_HEADER, USER_HEADER, Session, current_session, session_from_header
|
|
43
|
+
from agent_authorizer._toolkit import (
|
|
44
|
+
EFFECTS,
|
|
45
|
+
AuthDecision,
|
|
46
|
+
Authorizer,
|
|
47
|
+
Call,
|
|
48
|
+
CredentialSource,
|
|
49
|
+
Effect,
|
|
50
|
+
ToolError,
|
|
51
|
+
Toolkit,
|
|
52
|
+
ToolRefused,
|
|
53
|
+
ToolSpec,
|
|
54
|
+
spec_of,
|
|
55
|
+
)
|
|
56
|
+
from agent_authorizer._version import __version__
|
|
57
|
+
from agent_authorizer._watch import Watch, watch
|
|
58
|
+
from agent_authorizer._wire import ActionRefused
|
|
59
|
+
from agent_authorizer._wire import install as intercept
|
|
60
|
+
from agent_authorizer.core.secret import env, file, literal
|
|
61
|
+
|
|
62
|
+
__all__ = [
|
|
63
|
+
"ALLOW",
|
|
64
|
+
"DENY",
|
|
65
|
+
"EFFECTS",
|
|
66
|
+
"FENCE_END",
|
|
67
|
+
"FENCE_START",
|
|
68
|
+
"GROUPS_HEADER",
|
|
69
|
+
"KEY_HEADER",
|
|
70
|
+
"SESSION_HEADER",
|
|
71
|
+
"TOKEN_HEADER",
|
|
72
|
+
"UNKNOWN",
|
|
73
|
+
"USER_HEADER",
|
|
74
|
+
"ActionRecorder",
|
|
75
|
+
"ActionRefused",
|
|
76
|
+
"AgentAuthorizer",
|
|
77
|
+
"AuditEvent",
|
|
78
|
+
"AuditSink",
|
|
79
|
+
"AuthDecision",
|
|
80
|
+
"Authorizer",
|
|
81
|
+
"Call",
|
|
82
|
+
"CredentialSource",
|
|
83
|
+
"Decision",
|
|
84
|
+
"Effect",
|
|
85
|
+
"Entitlement",
|
|
86
|
+
"Entitlements",
|
|
87
|
+
"Fenced",
|
|
88
|
+
"GroupsSource",
|
|
89
|
+
"ObservedAction",
|
|
90
|
+
"PermissionDenied",
|
|
91
|
+
"ScopeRule",
|
|
92
|
+
"Session",
|
|
93
|
+
"ToolEntitlements",
|
|
94
|
+
"ToolError",
|
|
95
|
+
"ToolRefused",
|
|
96
|
+
"ToolSpec",
|
|
97
|
+
"Toolkit",
|
|
98
|
+
"UserSource",
|
|
99
|
+
"Validator",
|
|
100
|
+
"Watch",
|
|
101
|
+
"__version__",
|
|
102
|
+
"as_agent",
|
|
103
|
+
"as_user",
|
|
104
|
+
"configure",
|
|
105
|
+
"current",
|
|
106
|
+
"current_call",
|
|
107
|
+
"current_session",
|
|
108
|
+
"default_toolkit",
|
|
109
|
+
"env",
|
|
110
|
+
"fence",
|
|
111
|
+
"file",
|
|
112
|
+
"guarded",
|
|
113
|
+
"intercept",
|
|
114
|
+
"literal",
|
|
115
|
+
"log_audit",
|
|
116
|
+
"neutralize",
|
|
117
|
+
"permission_check",
|
|
118
|
+
"secured_tool",
|
|
119
|
+
"session_from_header",
|
|
120
|
+
"spec_of",
|
|
121
|
+
"tool",
|
|
122
|
+
"watch",
|
|
123
|
+
]
|