toolpass 0.7.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.
- toolpass-0.7.0/.gitignore +8 -0
- toolpass-0.7.0/LICENSE +202 -0
- toolpass-0.7.0/PKG-INFO +466 -0
- toolpass-0.7.0/README.md +421 -0
- toolpass-0.7.0/examples/claude_agent_sdk_agent.py +60 -0
- toolpass-0.7.0/examples/crewai_agent.py +54 -0
- toolpass-0.7.0/examples/google_adk_agent.py +56 -0
- toolpass-0.7.0/examples/langchain_agent.py +58 -0
- toolpass-0.7.0/examples/llamaindex_agent.py +54 -0
- toolpass-0.7.0/examples/mcp_server.py +56 -0
- toolpass-0.7.0/examples/openai_agents_agent.py +66 -0
- toolpass-0.7.0/examples/ops_agent.py +165 -0
- toolpass-0.7.0/examples/pydantic_ai_agent.py +58 -0
- toolpass-0.7.0/examples/strands_agent.py +51 -0
- toolpass-0.7.0/pyproject.toml +118 -0
- toolpass-0.7.0/src/toolpass/__init__.py +102 -0
- toolpass-0.7.0/src/toolpass/_api.py +568 -0
- toolpass-0.7.0/src/toolpass/_approval.py +250 -0
- toolpass-0.7.0/src/toolpass/_audit.py +75 -0
- toolpass-0.7.0/src/toolpass/_checks.py +258 -0
- toolpass-0.7.0/src/toolpass/_default.py +39 -0
- toolpass-0.7.0/src/toolpass/_permissions.py +53 -0
- toolpass-0.7.0/src/toolpass/_rules.py +224 -0
- toolpass-0.7.0/src/toolpass/_session.py +120 -0
- toolpass-0.7.0/src/toolpass/_toolkit.py +813 -0
- toolpass-0.7.0/src/toolpass/_untrusted.py +77 -0
- toolpass-0.7.0/src/toolpass/_version.py +1 -0
- toolpass-0.7.0/src/toolpass/_walk.py +48 -0
- toolpass-0.7.0/src/toolpass/authx/__init__.py +6 -0
- toolpass-0.7.0/src/toolpass/authx/awscreds.py +295 -0
- toolpass-0.7.0/src/toolpass/authx/awsquery.py +225 -0
- toolpass-0.7.0/src/toolpass/authx/google.py +89 -0
- toolpass-0.7.0/src/toolpass/authx/jwt.py +283 -0
- toolpass-0.7.0/src/toolpass/authx/oauth2.py +180 -0
- toolpass-0.7.0/src/toolpass/authx/sigv4.py +271 -0
- toolpass-0.7.0/src/toolpass/authx/sts.py +177 -0
- toolpass-0.7.0/src/toolpass/authx/token.py +137 -0
- toolpass-0.7.0/src/toolpass/authx/util.py +446 -0
- toolpass-0.7.0/src/toolpass/authx/xmlutil.py +92 -0
- toolpass-0.7.0/src/toolpass/claude_agent_sdk.py +187 -0
- toolpass-0.7.0/src/toolpass/cli.py +612 -0
- toolpass-0.7.0/src/toolpass/core/__init__.py +0 -0
- toolpass-0.7.0/src/toolpass/core/cache.py +413 -0
- toolpass-0.7.0/src/toolpass/core/catalog.py +237 -0
- toolpass-0.7.0/src/toolpass/core/config.py +680 -0
- toolpass-0.7.0/src/toolpass/core/context.py +233 -0
- toolpass-0.7.0/src/toolpass/core/decision.py +204 -0
- toolpass-0.7.0/src/toolpass/core/declog.py +113 -0
- toolpass-0.7.0/src/toolpass/core/duration.py +144 -0
- toolpass-0.7.0/src/toolpass/core/engine.py +408 -0
- toolpass-0.7.0/src/toolpass/core/errors.py +185 -0
- toolpass-0.7.0/src/toolpass/core/evidence.py +324 -0
- toolpass-0.7.0/src/toolpass/core/integration.py +497 -0
- toolpass-0.7.0/src/toolpass/core/jsonx.py +135 -0
- toolpass-0.7.0/src/toolpass/core/log.py +188 -0
- toolpass-0.7.0/src/toolpass/core/secret.py +146 -0
- toolpass-0.7.0/src/toolpass/core/template.py +126 -0
- toolpass-0.7.0/src/toolpass/crewai.py +208 -0
- toolpass-0.7.0/src/toolpass/google_adk.py +229 -0
- toolpass-0.7.0/src/toolpass/integrations/__init__.py +46 -0
- toolpass-0.7.0/src/toolpass/integrations/argocd/__init__.py +341 -0
- toolpass-0.7.0/src/toolpass/integrations/argocd/actions.py +160 -0
- toolpass-0.7.0/src/toolpass/integrations/argocd/rbac/__init__.py +452 -0
- toolpass-0.7.0/src/toolpass/integrations/argocd/rbac/builtin.py +67 -0
- toolpass-0.7.0/src/toolpass/integrations/argocd/rbac/glob.py +213 -0
- toolpass-0.7.0/src/toolpass/integrations/argocd/rbac/re2.py +595 -0
- toolpass-0.7.0/src/toolpass/integrations/aws/__init__.py +9 -0
- toolpass-0.7.0/src/toolpass/integrations/aws/actions.py +138 -0
- toolpass-0.7.0/src/toolpass/integrations/aws/aws.py +675 -0
- toolpass-0.7.0/src/toolpass/integrations/aws/identity.py +484 -0
- toolpass-0.7.0/src/toolpass/integrations/azure/__init__.py +9 -0
- toolpass-0.7.0/src/toolpass/integrations/azure/actions.py +230 -0
- toolpass-0.7.0/src/toolpass/integrations/azure/azure.py +735 -0
- toolpass-0.7.0/src/toolpass/integrations/bitbucket/__init__.py +162 -0
- toolpass-0.7.0/src/toolpass/integrations/bitbucket/actions.py +259 -0
- toolpass-0.7.0/src/toolpass/integrations/bitbucket/cloud.py +429 -0
- toolpass-0.7.0/src/toolpass/integrations/bitbucket/common.py +106 -0
- toolpass-0.7.0/src/toolpass/integrations/bitbucket/datacenter.py +465 -0
- toolpass-0.7.0/src/toolpass/integrations/confluence/__init__.py +11 -0
- toolpass-0.7.0/src/toolpass/integrations/confluence/actions.py +97 -0
- toolpass-0.7.0/src/toolpass/integrations/confluence/confluence.py +407 -0
- toolpass-0.7.0/src/toolpass/integrations/databricks/__init__.py +9 -0
- toolpass-0.7.0/src/toolpass/integrations/databricks/actions.py +381 -0
- toolpass-0.7.0/src/toolpass/integrations/databricks/databricks.py +651 -0
- toolpass-0.7.0/src/toolpass/integrations/datadog/__init__.py +9 -0
- toolpass-0.7.0/src/toolpass/integrations/datadog/actions.py +167 -0
- toolpass-0.7.0/src/toolpass/integrations/datadog/datadog.py +465 -0
- toolpass-0.7.0/src/toolpass/integrations/fake.py +103 -0
- toolpass-0.7.0/src/toolpass/integrations/github/__init__.py +10 -0
- toolpass-0.7.0/src/toolpass/integrations/github/actions.py +210 -0
- toolpass-0.7.0/src/toolpass/integrations/github/github.py +965 -0
- toolpass-0.7.0/src/toolpass/integrations/github/identity.py +448 -0
- toolpass-0.7.0/src/toolpass/integrations/gitlab/__init__.py +916 -0
- toolpass-0.7.0/src/toolpass/integrations/gitlab/actions.py +222 -0
- toolpass-0.7.0/src/toolpass/integrations/googlecloud/__init__.py +10 -0
- toolpass-0.7.0/src/toolpass/integrations/googlecloud/actions.py +307 -0
- toolpass-0.7.0/src/toolpass/integrations/googlecloud/googlecloud.py +526 -0
- toolpass-0.7.0/src/toolpass/integrations/googleworkspace/__init__.py +10 -0
- toolpass-0.7.0/src/toolpass/integrations/googleworkspace/actions.py +84 -0
- toolpass-0.7.0/src/toolpass/integrations/googleworkspace/googleworkspace.py +790 -0
- toolpass-0.7.0/src/toolpass/integrations/jira/__init__.py +27 -0
- toolpass-0.7.0/src/toolpass/integrations/jira/actions.py +114 -0
- toolpass-0.7.0/src/toolpass/integrations/jira/jira.py +446 -0
- toolpass-0.7.0/src/toolpass/integrations/jira/site.py +219 -0
- toolpass-0.7.0/src/toolpass/integrations/kubernetes/__init__.py +346 -0
- toolpass-0.7.0/src/toolpass/integrations/kubernetes/actions.py +197 -0
- toolpass-0.7.0/src/toolpass/integrations/linear/__init__.py +10 -0
- toolpass-0.7.0/src/toolpass/integrations/linear/actions.py +116 -0
- toolpass-0.7.0/src/toolpass/integrations/linear/linear.py +655 -0
- toolpass-0.7.0/src/toolpass/integrations/microsoft365/__init__.py +10 -0
- toolpass-0.7.0/src/toolpass/integrations/microsoft365/actions.py +136 -0
- toolpass-0.7.0/src/toolpass/integrations/microsoft365/microsoft365.py +992 -0
- toolpass-0.7.0/src/toolpass/integrations/pagerduty/__init__.py +9 -0
- toolpass-0.7.0/src/toolpass/integrations/pagerduty/actions.py +140 -0
- toolpass-0.7.0/src/toolpass/integrations/pagerduty/pagerduty.py +435 -0
- toolpass-0.7.0/src/toolpass/integrations/salesforce/__init__.py +13 -0
- toolpass-0.7.0/src/toolpass/integrations/salesforce/actions.py +158 -0
- toolpass-0.7.0/src/toolpass/integrations/salesforce/salesforce.py +1304 -0
- toolpass-0.7.0/src/toolpass/integrations/salesforce/soql.py +493 -0
- toolpass-0.7.0/src/toolpass/integrations/slack/__init__.py +10 -0
- toolpass-0.7.0/src/toolpass/integrations/slack/actions.py +84 -0
- toolpass-0.7.0/src/toolpass/integrations/slack/slack.py +961 -0
- toolpass-0.7.0/src/toolpass/integrations/snowflake/__init__.py +12 -0
- toolpass-0.7.0/src/toolpass/integrations/snowflake/actions.py +172 -0
- toolpass-0.7.0/src/toolpass/integrations/snowflake/snowflake.py +676 -0
- toolpass-0.7.0/src/toolpass/integrations/snowflake/sql.py +101 -0
- toolpass-0.7.0/src/toolpass/integrations/vault/__init__.py +9 -0
- toolpass-0.7.0/src/toolpass/integrations/vault/actions.py +122 -0
- toolpass-0.7.0/src/toolpass/integrations/vault/policy.py +816 -0
- toolpass-0.7.0/src/toolpass/integrations/vault/vault.py +799 -0
- toolpass-0.7.0/src/toolpass/integrations/zendesk/__init__.py +9 -0
- toolpass-0.7.0/src/toolpass/integrations/zendesk/actions.py +90 -0
- toolpass-0.7.0/src/toolpass/integrations/zendesk/zendesk.py +789 -0
- toolpass-0.7.0/src/toolpass/langchain.py +237 -0
- toolpass-0.7.0/src/toolpass/llamaindex.py +186 -0
- toolpass-0.7.0/src/toolpass/mcp.py +237 -0
- toolpass-0.7.0/src/toolpass/net/__init__.py +0 -0
- toolpass-0.7.0/src/toolpass/net/httpx.py +1404 -0
- toolpass-0.7.0/src/toolpass/openai_agents.py +198 -0
- toolpass-0.7.0/src/toolpass/py.typed +0 -0
- toolpass-0.7.0/src/toolpass/pydantic_ai.py +202 -0
- toolpass-0.7.0/src/toolpass/server.py +517 -0
- toolpass-0.7.0/src/toolpass/strands.py +148 -0
- toolpass-0.7.0/tests/__init__.py +0 -0
- toolpass-0.7.0/tests/authx/__init__.py +0 -0
- toolpass-0.7.0/tests/authx/test_aws.py +403 -0
- toolpass-0.7.0/tests/authx/test_jwt.py +97 -0
- toolpass-0.7.0/tests/authx/test_oauth2.py +174 -0
- toolpass-0.7.0/tests/authx/test_rfc7515.py +73 -0
- toolpass-0.7.0/tests/authx/test_sigv4.py +144 -0
- toolpass-0.7.0/tests/authx/test_token.py +260 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.creq +9 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.req +6 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.sreq +7 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.creq +9 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.req +6 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.sreq +7 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.creq +9 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.req +7 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.sreq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.creq +10 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.req +5 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.sreq +6 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-unreserved/get-unreserved.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-unreserved/get-unreserved.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-unreserved/get-unreserved.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-unreserved/get-unreserved.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-unreserved/get-unreserved.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-utf8/get-utf8.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-utf8/get-utf8.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-utf8/get-utf8.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-utf8/get-utf8.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-utf8/get-utf8.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla/get-vanilla.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla/get-vanilla.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla/get-vanilla.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla/get-vanilla.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla/get-vanilla.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query-order-key-case/get-vanilla-query-order-key-case.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query-order-key-case/get-vanilla-query-order-key-case.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query-order-key-case/get-vanilla-query-order-key-case.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query-order-key-case/get-vanilla-query-order-key-case.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query-order-key-case/get-vanilla-query-order-key-case.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.creq +9 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.req +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.sreq +5 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.creq +9 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.req +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.sreq +5 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla/post-vanilla.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla/post-vanilla.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla/post-vanilla.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla/post-vanilla.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla/post-vanilla.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.creq +8 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.req +3 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.sreq +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.creq +9 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.req +6 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.sreq +7 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.sts +4 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters.authz +1 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters.creq +9 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters.req +6 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters.sreq +7 -0
- toolpass-0.7.0/tests/authx/testdata/aws-sig-v4-test-suite/post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters.sts +4 -0
- toolpass-0.7.0/tests/conftest.py +53 -0
- toolpass-0.7.0/tests/contract/__init__.py +0 -0
- toolpass-0.7.0/tests/contract/conftest.py +10 -0
- toolpass-0.7.0/tests/contract/key.py +16 -0
- toolpass-0.7.0/tests/contract/test_prism.py +427 -0
- toolpass-0.7.0/tests/core/__init__.py +0 -0
- toolpass-0.7.0/tests/core/test_cache.py +1099 -0
- toolpass-0.7.0/tests/core/test_catalog.py +273 -0
- toolpass-0.7.0/tests/core/test_config.py +375 -0
- toolpass-0.7.0/tests/core/test_decision.py +192 -0
- toolpass-0.7.0/tests/core/test_declog.py +112 -0
- toolpass-0.7.0/tests/core/test_duration.py +69 -0
- toolpass-0.7.0/tests/core/test_engine.py +436 -0
- toolpass-0.7.0/tests/core/test_engine_evidence.py +294 -0
- toolpass-0.7.0/tests/core/test_evidence.py +182 -0
- toolpass-0.7.0/tests/core/test_integration.py +283 -0
- toolpass-0.7.0/tests/core/test_secret.py +163 -0
- toolpass-0.7.0/tests/core/test_template.py +197 -0
- toolpass-0.7.0/tests/core/testdata/catalog_fuzz/FuzzParseResource/15aac6b49c47082f +2 -0
- toolpass-0.7.0/tests/core/testdata/catalog_fuzz/FuzzParseResource/c1-control-in-query +2 -0
- toolpass-0.7.0/tests/differential/__init__.py +0 -0
- toolpass-0.7.0/tests/differential/test_argocd.py +223 -0
- toolpass-0.7.0/tests/e2e/__init__.py +0 -0
- toolpass-0.7.0/tests/e2e/test_kubernetes.py +87 -0
- toolpass-0.7.0/tests/frameworks/__init__.py +0 -0
- toolpass-0.7.0/tests/frameworks/test_claude_agent_sdk.py +590 -0
- toolpass-0.7.0/tests/frameworks/test_crewai.py +418 -0
- toolpass-0.7.0/tests/frameworks/test_google_adk.py +458 -0
- toolpass-0.7.0/tests/frameworks/test_langchain.py +643 -0
- toolpass-0.7.0/tests/frameworks/test_llamaindex.py +446 -0
- toolpass-0.7.0/tests/frameworks/test_mcp.py +686 -0
- toolpass-0.7.0/tests/frameworks/test_openai_agents.py +396 -0
- toolpass-0.7.0/tests/frameworks/test_pydantic_ai.py +388 -0
- toolpass-0.7.0/tests/frameworks/test_strands.py +690 -0
- toolpass-0.7.0/tests/harness/__init__.py +610 -0
- toolpass-0.7.0/tests/harness/graphql.py +870 -0
- toolpass-0.7.0/tests/harness/spec.py +945 -0
- toolpass-0.7.0/tests/harness_tests/__init__.py +0 -0
- toolpass-0.7.0/tests/harness_tests/test_graphql.py +142 -0
- toolpass-0.7.0/tests/harness_tests/test_spec.py +263 -0
- toolpass-0.7.0/tests/integrations/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/argocd/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/argocd/rbac/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/argocd/rbac/test_glob.py +79 -0
- toolpass-0.7.0/tests/integrations/argocd/rbac/test_rbac.py +332 -0
- toolpass-0.7.0/tests/integrations/argocd/rbac/test_re2.py +87 -0
- toolpass-0.7.0/tests/integrations/argocd/test_argocd.py +790 -0
- toolpass-0.7.0/tests/integrations/argocd/test_fuzz.py +93 -0
- toolpass-0.7.0/tests/integrations/aws/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/aws/test_aws.py +1359 -0
- toolpass-0.7.0/tests/integrations/aws/test_fuzz.py +76 -0
- toolpass-0.7.0/tests/integrations/azure/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/azure/test_azure.py +969 -0
- toolpass-0.7.0/tests/integrations/azure/test_fuzz.py +110 -0
- toolpass-0.7.0/tests/integrations/bitbucket/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/bitbucket/common.py +60 -0
- toolpass-0.7.0/tests/integrations/bitbucket/conftest.py +15 -0
- toolpass-0.7.0/tests/integrations/bitbucket/test_cloud.py +602 -0
- toolpass-0.7.0/tests/integrations/bitbucket/test_datacenter.py +435 -0
- toolpass-0.7.0/tests/integrations/bitbucket/test_fuzz.py +72 -0
- toolpass-0.7.0/tests/integrations/confluence/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/confluence/test_confluence.py +778 -0
- toolpass-0.7.0/tests/integrations/confluence/test_fuzz.py +52 -0
- toolpass-0.7.0/tests/integrations/databricks/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/databricks/test_databricks.py +889 -0
- toolpass-0.7.0/tests/integrations/databricks/test_fuzz.py +99 -0
- toolpass-0.7.0/tests/integrations/datadog/__init__.py +1 -0
- toolpass-0.7.0/tests/integrations/datadog/test_datadog.py +622 -0
- toolpass-0.7.0/tests/integrations/datadog/test_fuzz.py +69 -0
- toolpass-0.7.0/tests/integrations/github/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/github/test_fuzz.py +81 -0
- toolpass-0.7.0/tests/integrations/github/test_github.py +1543 -0
- toolpass-0.7.0/tests/integrations/gitlab/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/gitlab/test_fuzz.py +70 -0
- toolpass-0.7.0/tests/integrations/gitlab/test_gitlab.py +1313 -0
- toolpass-0.7.0/tests/integrations/googlecloud/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/googlecloud/test_fuzz.py +92 -0
- toolpass-0.7.0/tests/integrations/googlecloud/test_googlecloud.py +902 -0
- toolpass-0.7.0/tests/integrations/googleworkspace/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/googleworkspace/test_fuzz.py +75 -0
- toolpass-0.7.0/tests/integrations/googleworkspace/test_googleworkspace.py +1067 -0
- toolpass-0.7.0/tests/integrations/jira/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/jira/test_fuzz.py +54 -0
- toolpass-0.7.0/tests/integrations/jira/test_jira.py +942 -0
- toolpass-0.7.0/tests/integrations/kubernetes/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/kubernetes/test_fuzz.py +84 -0
- toolpass-0.7.0/tests/integrations/kubernetes/test_kubernetes.py +469 -0
- toolpass-0.7.0/tests/integrations/linear/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/linear/test_fuzz.py +78 -0
- toolpass-0.7.0/tests/integrations/linear/test_linear.py +629 -0
- toolpass-0.7.0/tests/integrations/microsoft365/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/microsoft365/test_fuzz.py +109 -0
- toolpass-0.7.0/tests/integrations/microsoft365/test_microsoft365.py +1206 -0
- toolpass-0.7.0/tests/integrations/pagerduty/__init__.py +1 -0
- toolpass-0.7.0/tests/integrations/pagerduty/test_fuzz.py +59 -0
- toolpass-0.7.0/tests/integrations/pagerduty/test_pagerduty.py +513 -0
- toolpass-0.7.0/tests/integrations/salesforce/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/salesforce/test_fuzz.py +111 -0
- toolpass-0.7.0/tests/integrations/salesforce/test_salesforce.py +1434 -0
- toolpass-0.7.0/tests/integrations/salesforce/test_soql.py +130 -0
- toolpass-0.7.0/tests/integrations/slack/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/slack/test_fuzz.py +71 -0
- toolpass-0.7.0/tests/integrations/slack/test_slack.py +1197 -0
- toolpass-0.7.0/tests/integrations/snowflake/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/snowflake/test_fuzz.py +111 -0
- toolpass-0.7.0/tests/integrations/snowflake/test_snowflake.py +958 -0
- toolpass-0.7.0/tests/integrations/test_fake.py +92 -0
- toolpass-0.7.0/tests/integrations/test_registry.py +73 -0
- toolpass-0.7.0/tests/integrations/vault/__init__.py +0 -0
- toolpass-0.7.0/tests/integrations/vault/test_fuzz.py +271 -0
- toolpass-0.7.0/tests/integrations/vault/test_vault.py +815 -0
- toolpass-0.7.0/tests/integrations/vault/testdata/fuzz/FuzzPolicy/67b6d4b865042ef7 +2 -0
- toolpass-0.7.0/tests/integrations/zendesk/__init__.py +1 -0
- toolpass-0.7.0/tests/integrations/zendesk/test_fuzz.py +72 -0
- toolpass-0.7.0/tests/integrations/zendesk/test_zendesk.py +797 -0
- toolpass-0.7.0/tests/live/__init__.py +0 -0
- toolpass-0.7.0/tests/live/conftest.py +116 -0
- toolpass-0.7.0/tests/live/test_live.py +281 -0
- toolpass-0.7.0/tests/net/__init__.py +0 -0
- toolpass-0.7.0/tests/net/test_httpx.py +1034 -0
- toolpass-0.7.0/tests/real/__init__.py +0 -0
- toolpass-0.7.0/tests/real/test_vault_real.py +453 -0
- toolpass-0.7.0/tests/scenarios/__init__.py +0 -0
- toolpass-0.7.0/tests/scenarios/scenarios/argocd.yaml +203 -0
- toolpass-0.7.0/tests/scenarios/scenarios/azure.yaml +311 -0
- toolpass-0.7.0/tests/scenarios/scenarios/bitbucket.yaml +167 -0
- toolpass-0.7.0/tests/scenarios/scenarios/confluence.yaml +196 -0
- toolpass-0.7.0/tests/scenarios/scenarios/databricks.yaml +117 -0
- toolpass-0.7.0/tests/scenarios/scenarios/datadog.yaml +122 -0
- toolpass-0.7.0/tests/scenarios/scenarios/fake.yaml +32 -0
- toolpass-0.7.0/tests/scenarios/scenarios/github.yaml +224 -0
- toolpass-0.7.0/tests/scenarios/scenarios/gitlab.yaml +131 -0
- toolpass-0.7.0/tests/scenarios/scenarios/googlecloud.yaml +509 -0
- toolpass-0.7.0/tests/scenarios/scenarios/googleworkspace.yaml +133 -0
- toolpass-0.7.0/tests/scenarios/scenarios/jira.yaml +262 -0
- toolpass-0.7.0/tests/scenarios/scenarios/kubernetes.yaml +164 -0
- toolpass-0.7.0/tests/scenarios/scenarios/linear.yaml +204 -0
- toolpass-0.7.0/tests/scenarios/scenarios/microsoft365.yaml +125 -0
- toolpass-0.7.0/tests/scenarios/scenarios/pagerduty.yaml +98 -0
- toolpass-0.7.0/tests/scenarios/scenarios/salesforce.yaml +227 -0
- toolpass-0.7.0/tests/scenarios/scenarios/slack.yaml +252 -0
- toolpass-0.7.0/tests/scenarios/scenarios/snowflake.yaml +183 -0
- toolpass-0.7.0/tests/scenarios/scenarios/vault.yaml +142 -0
- toolpass-0.7.0/tests/scenarios/scenarios/zendesk.yaml +149 -0
- toolpass-0.7.0/tests/scenarios/test_scenarios.py +106 -0
- toolpass-0.7.0/tests/test_cli.py +454 -0
- toolpass-0.7.0/tests/test_remote.py +153 -0
- toolpass-0.7.0/tests/test_server.py +380 -0
- toolpass-0.7.0/tests/toolkit/__init__.py +0 -0
- toolpass-0.7.0/tests/toolkit/conftest.py +40 -0
- toolpass-0.7.0/tests/toolkit/test_arguments.py +196 -0
- toolpass-0.7.0/tests/toolkit/test_basics.py +252 -0
- toolpass-0.7.0/tests/toolkit/test_credentials_and_frameworks.py +176 -0
- toolpass-0.7.0/tests/toolkit/test_example.py +28 -0
- toolpass-0.7.0/tests/toolkit/test_exfiltration_and_approval.py +273 -0
- toolpass-0.7.0/tests/toolkit/test_fail_closed.py +747 -0
- toolpass-0.7.0/tests/toolkit/test_limits_and_authorization.py +270 -0
- toolpass-0.7.0/tests/toolkit/test_secured_tool.py +103 -0
- toolpass-0.7.0/tests/toolkit/test_untrusted.py +183 -0
toolpass-0.7.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
toolpass-0.7.0/PKG-INFO
ADDED
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: toolpass
|
|
3
|
+
Version: 0.7.0
|
|
4
|
+
Summary: A pass for every tool call: secure-by-default tools for AI agents (scope, approval, prompt-injection and exfiltration guards, credential injection, audit) with permission checks answered live by the systems they act in.
|
|
5
|
+
Project-URL: Homepage, https://github.com/roee-hersh/toolpass
|
|
6
|
+
Project-URL: Documentation, https://github.com/roee-hersh/toolpass/tree/main/docs
|
|
7
|
+
Project-URL: Issues, https://github.com/roee-hersh/toolpass/issues
|
|
8
|
+
Project-URL: Source, https://github.com/roee-hersh/toolpass/tree/main/toolpass-py
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai-agents,authorization,langchain,llm,mcp,permissions,prompt-injection,security,tools
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Security
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: pyyaml>=6.0.1
|
|
23
|
+
Provides-Extra: claude-agent-sdk
|
|
24
|
+
Requires-Dist: claude-agent-sdk>=0.2.160; extra == 'claude-agent-sdk'
|
|
25
|
+
Provides-Extra: crewai
|
|
26
|
+
Requires-Dist: crewai>=1.15; extra == 'crewai'
|
|
27
|
+
Provides-Extra: crypto
|
|
28
|
+
Requires-Dist: cryptography>=42; extra == 'crypto'
|
|
29
|
+
Provides-Extra: google-adk
|
|
30
|
+
Requires-Dist: google-adk>=2.10; extra == 'google-adk'
|
|
31
|
+
Provides-Extra: langchain
|
|
32
|
+
Requires-Dist: langchain>=1.4; extra == 'langchain'
|
|
33
|
+
Requires-Dist: langgraph>=1.2; extra == 'langchain'
|
|
34
|
+
Provides-Extra: llamaindex
|
|
35
|
+
Requires-Dist: llama-index-core>=0.14; extra == 'llamaindex'
|
|
36
|
+
Provides-Extra: mcp
|
|
37
|
+
Requires-Dist: mcp>=2.1; extra == 'mcp'
|
|
38
|
+
Provides-Extra: openai-agents
|
|
39
|
+
Requires-Dist: openai-agents>=0.22; extra == 'openai-agents'
|
|
40
|
+
Provides-Extra: pydantic-ai
|
|
41
|
+
Requires-Dist: pydantic-ai-slim>=2.51; extra == 'pydantic-ai'
|
|
42
|
+
Provides-Extra: strands
|
|
43
|
+
Requires-Dist: strands-agents>=1.57.1; extra == 'strands'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# toolpass
|
|
47
|
+
|
|
48
|
+
**A pass for every tool call: secure-by-default tools for AI agents, under any agent framework.**
|
|
49
|
+
|
|
50
|
+
> The secure-tools API (`Toolkit`, `Session`, approvals) is alpha and may still change; the permission
|
|
51
|
+
> engine (`Toolpass`, `guarded`, the adapters) is stable.
|
|
52
|
+
|
|
53
|
+
Teams write custom tools for their own agents: open a pull request against the GitOps repository,
|
|
54
|
+
scale a deployment, read customer records, post to Slack. Those tools usually run with one service
|
|
55
|
+
credential for everyone who talks to the agent, and every team rebuilds the same safety checks
|
|
56
|
+
by hand, or skips them. toolpass is a decorator that adds those checks to a plain Python
|
|
57
|
+
function:
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
import toolpass
|
|
61
|
+
from toolpass import ApprovalQueue, Session, Toolpass, permission_check, secured_tool
|
|
62
|
+
|
|
63
|
+
tp = Toolpass.from_config("toolpass.yaml") # permission checks; see below
|
|
64
|
+
approvals = ApprovalQueue()
|
|
65
|
+
toolpass.configure(approver=approvals, credentials={"github-bot": github_token}, limits={"destructive": 3})
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
@secured_tool(
|
|
69
|
+
effect="write",
|
|
70
|
+
scope={"repo": "acme/gitops-*"}, # the tool itself can touch nothing else
|
|
71
|
+
authorize=permission_check(tp, "github-acme", "pull_request.create", "repo:{repo}"),
|
|
72
|
+
approve=True, # a person confirms, out of band
|
|
73
|
+
credential="github-bot", # injected below; the model never sees it
|
|
74
|
+
)
|
|
75
|
+
def open_gitops_pr(repo: str, title: str, change: str, *, credential: str) -> str:
|
|
76
|
+
...
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
with Session("dana@example.com").active(): # the user your app authenticated
|
|
80
|
+
agent.run(prompt)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The decorated function keeps its signature (minus the injected `credential`), so LangChain,
|
|
84
|
+
Pydantic AI, CrewAI, the OpenAI Agents SDK or your own loop can put their own `@tool` on top. No
|
|
85
|
+
adapter is needed. Or let `secured_tool` apply it: `as_tool=` takes the framework's decorator and
|
|
86
|
+
returns that framework's tool, with every check inside.
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
from langchain_core.tools import tool
|
|
90
|
+
|
|
91
|
+
@secured_tool(effect="read", untrusted_output=True, as_tool=tool)
|
|
92
|
+
def read_email(id: str) -> str: ...
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Some frameworks hide a tool's exception from the model (the OpenAI Agents SDK's `function_tool`
|
|
96
|
+
answers "An error occurred while running the tool"). There, `toolpass.configure(on_refuse=str)` makes
|
|
97
|
+
a refusal the tool's result, so the model can tell the user why.
|
|
98
|
+
|
|
99
|
+
`toolpass.configure(...)` sets up the default behind `secured_tool`; tools declared earlier pick the
|
|
100
|
+
settings up at call time. A program that needs two sets of settings makes `Toolkit(...)` objects
|
|
101
|
+
and uses their `secured_tool`.
|
|
102
|
+
|
|
103
|
+
## What a tool can declare
|
|
104
|
+
|
|
105
|
+
| Protection | Declared with | What it guarantees |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| User from the session | `Session(user).active()` | The user comes from your app, never from the model's arguments |
|
|
108
|
+
| Argument validation | type hints, `validate={...}` | `str` is a `str`, `Literal` is one of its values; your validators run before anything else |
|
|
109
|
+
| Scope limits | `scope={"repo": "acme/gitops-*"}` | The tool can only touch what it declares, whoever asks |
|
|
110
|
+
| Action limits | `limit=`, `Toolkit(limits={"destructive": 3})` | A loop or an injection cannot run 200 deletes in one session |
|
|
111
|
+
| User authorization | `authorize=permission_check(...)` or any callable | The call runs only if the person asking may do it |
|
|
112
|
+
| Untrusted-input check | `untrusted_output=True` on readers | An action whose arguments repeat untrusted content (an email, a web page) is refused |
|
|
113
|
+
| Fencing | automatic for untrusted string output | Untrusted text reaches the model inside a nonce-tagged block marked as data |
|
|
114
|
+
| Exfiltration guard | `reads_private=True`, `sends_out=True` | Once a session has read private data and seen untrusted content, nothing is sent out without approval |
|
|
115
|
+
| Human approval | `approve=True` or a predicate, `preview=` | A person confirms, out of band, the exact call; the approval is used once |
|
|
116
|
+
| Credential injection | `credential="name"` | The secret is fetched after every check and never enters the model's context; echoes of it in the output are redacted |
|
|
117
|
+
| Audit | `Toolkit(audit=...)` | One event per call, refused or run, with who asked and why it was decided |
|
|
118
|
+
|
|
119
|
+
## The order of checks
|
|
120
|
+
|
|
121
|
+
Every call goes through the same steps. A failed step refuses the call before the tool's body runs,
|
|
122
|
+
and anything that cannot be evaluated (an authorizer that raises, an approver that is down) refuses
|
|
123
|
+
too.
|
|
124
|
+
|
|
125
|
+
1. **Session.** No current session means no call.
|
|
126
|
+
2. **Arguments.** Types, then validators, then scope rules.
|
|
127
|
+
3. **Limits.** One slot is taken from each cap, and given back if the call never reaches its body.
|
|
128
|
+
4. **Authorization.** Only an explicit allow lets the call through.
|
|
129
|
+
5. **Untrusted input.** Arguments repeating six or more consecutive words of untrusted output
|
|
130
|
+
are refused (or sent for approval, with `on_untrusted_input="approve"`).
|
|
131
|
+
6. **Exfiltration.** A `sends_out` tool in a session that has read private data and seen
|
|
132
|
+
untrusted content needs approval (or is refused, with `exfiltration="refuse"`).
|
|
133
|
+
7. **Approval.** When the tool, step 5 or step 6 asks for it.
|
|
134
|
+
8. **Credential.** Fetched only now.
|
|
135
|
+
9. **The body.** Its output is redacted, recorded if untrusted, and fenced.
|
|
136
|
+
10. **Audit.** One event, whatever happened.
|
|
137
|
+
|
|
138
|
+
## The exfiltration guard
|
|
139
|
+
|
|
140
|
+
An agent can be made to leak data only when one session has all three of what Simon Willison calls
|
|
141
|
+
the lethal trifecta: access to private data, exposure to untrusted content, and a way to send data
|
|
142
|
+
out. Tools already declare which of these they are, so the toolkit tracks the first two per
|
|
143
|
+
session and guards the third:
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
@secured_tool(effect="read", reads_private=True)
|
|
147
|
+
def read_customers() -> str: ...
|
|
148
|
+
|
|
149
|
+
@secured_tool(effect="read", untrusted_output=True)
|
|
150
|
+
def read_email(id: str) -> str: ...
|
|
151
|
+
|
|
152
|
+
@secured_tool(effect="write", sends_out=True)
|
|
153
|
+
def post_slack(channel: str, text: str) -> str: ...
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
After `read_customers` and `read_email` have both run in a session, `post_slack` waits for a person.
|
|
157
|
+
This does not depend on spotting injected words, so a model that paraphrases the injection does not
|
|
158
|
+
get past it.
|
|
159
|
+
|
|
160
|
+
## Approval, out of band
|
|
161
|
+
|
|
162
|
+
`ApprovalQueue` keeps a call that needs approval until a person decides. The tool raises
|
|
163
|
+
`ApprovalPending`, whose message tells the model to ask the user and retry. Your app shows the
|
|
164
|
+
request to a person and approves it; the same call from the same session then runs once.
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
approvals.on_request(lambda req: slack.post("#approvals", req.describe())) # who, what, why, preview
|
|
168
|
+
|
|
169
|
+
# later, from the Slack button handler:
|
|
170
|
+
approvals.approve(request_id, by="dana@example.com")
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
An approval is bound to the session, the tool, the exact arguments, the reasons it was asked for
|
|
174
|
+
and the preview the person saw. It is spent only when the call reaches its body, so a credential
|
|
175
|
+
that was briefly unavailable does not cost another approval, and it expires after `ttl` seconds (15
|
|
176
|
+
minutes by default). Any callable that returns True, False or None can be the approver instead,
|
|
177
|
+
for example a prompt in a CLI.
|
|
178
|
+
|
|
179
|
+
In async tools, sync hooks (an authorizer, an approval rule, a preview, the approver and its
|
|
180
|
+
listeners, a credentials callable) run in a worker thread, so blocking I/O in them cannot stall the
|
|
181
|
+
event loop; pass `async def` hooks to run them on the loop.
|
|
182
|
+
|
|
183
|
+
## Refusals
|
|
184
|
+
|
|
185
|
+
A refused call raises `ToolRefused` with a `code` (`out_of_scope`, `not_authorized`,
|
|
186
|
+
`untrusted_input`, `approval_pending`, ...) and a message written for the model. Most frameworks pass
|
|
187
|
+
the exception's text back to the model. Where a framework hides it, `Toolkit(on_refuse=str)`
|
|
188
|
+
returns the message as the tool's result instead. A check that itself fails unexpectedly (a
|
|
189
|
+
scope predicate that crashes, a session source that is down) refuses with `check_error` or the
|
|
190
|
+
check's own code.
|
|
191
|
+
|
|
192
|
+
An exception from the tool's own body passes through unchanged, with two exceptions. If its message
|
|
193
|
+
contains the injected credential, or the tool is marked `untrusted_output` (its error text may
|
|
194
|
+
carry what it fetched), it is raised as `ToolError`: the secret redacted, the untrusted text
|
|
195
|
+
recorded and fenced, and the original exception kept on `.original` for your own logs.
|
|
196
|
+
|
|
197
|
+
A validator accepts by returning `True` (or any truthy value, such as a `re.Match`) and rejects by
|
|
198
|
+
returning anything falsy (`False`, `None`) or raising. Generator tools are not supported: return
|
|
199
|
+
the whole result. A returned iterator is turned into a list before redaction; an async iterator
|
|
200
|
+
is refused.
|
|
201
|
+
|
|
202
|
+
## Permission checks in tools
|
|
203
|
+
|
|
204
|
+
`permission_check` asks `Toolpass`, the permission engine in this package, whether the session's
|
|
205
|
+
user may perform the action, live, in the system that owns the resource (GitHub, Jira, Kubernetes,
|
|
206
|
+
AWS, and 17 more). It works with `Toolpass.from_config(...)` in-process or `Toolpass.remote(...)`
|
|
207
|
+
against a toolpass server. Any callable that returns `AuthDecision`, `True` or `False` can be the
|
|
208
|
+
authorizer instead. The engine also works on its own:
|
|
209
|
+
[permission checks on their own](#permission-checks-on-their-own), below.
|
|
210
|
+
|
|
211
|
+
## Limits
|
|
212
|
+
|
|
213
|
+
- **The untrusted-input check matches words, not meaning.** A model that paraphrases injected text,
|
|
214
|
+
or an argument shorter than six words, is not caught. The exfiltration guard and approval on
|
|
215
|
+
writes cover that gap; don't rely on this check alone.
|
|
216
|
+
- **Fencing helps, it does not guarantee.** Models can still be talked past markers.
|
|
217
|
+
- **Only string output is fenced.** Structured output is recorded as untrusted but returned as is.
|
|
218
|
+
- **Sessions live in memory.** Counts, flags and the approval queue do not survive a restart or
|
|
219
|
+
span processes yet.
|
|
220
|
+
- **Redaction matches the credential's literal text.** An encoded or split echo of it (base64, a
|
|
221
|
+
hex dump) is not caught, and strings shorter than 8 characters are never redacted.
|
|
222
|
+
- **`permission_check` puts argument values into the resource string as they are.** Give such
|
|
223
|
+
arguments a scope rule or validator, so a value carrying `?`, `@` or `#` cannot make the permission
|
|
224
|
+
check look at a different resource from the one the tool acts on.
|
|
225
|
+
- **Check and action are not atomic.** Authorization is checked, then the body runs; a permission
|
|
226
|
+
revoked in between is not noticed.
|
|
227
|
+
- **Session state reaches worker threads only through context.** Frameworks that run tools in
|
|
228
|
+
threads must copy the context (LangChain and `asyncio.to_thread` do).
|
|
229
|
+
|
|
230
|
+
## Run the example and the tests
|
|
231
|
+
|
|
232
|
+
```sh
|
|
233
|
+
pip install -e . pytest pytest-timeout hypothesis
|
|
234
|
+
python examples/ops_agent.py
|
|
235
|
+
python -m pytest -q
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
`examples/ops_agent.py` runs a scripted ops-agent session with no network: an injected email, a
|
|
239
|
+
blocked exfiltration attempt, a pull request that waits for approval, and a permission denial.
|
|
240
|
+
|
|
241
|
+
## Permission checks on their own
|
|
242
|
+
|
|
243
|
+
Permission checks for AI agents and bots, answered live by the system they act in.
|
|
244
|
+
|
|
245
|
+
Before your agent acts for a user (delete a Jira issue, push to a repository, scale a deployment),
|
|
246
|
+
ask toolpass whether that user may do it. toolpass asks the system that owns the resource, live,
|
|
247
|
+
with its own read-only credential, and answers `allow`, `deny` or `unknown`. It only checks; it
|
|
248
|
+
never performs the action. Twenty-one systems are supported: Kubernetes, Argo CD, GitHub, GitLab,
|
|
249
|
+
Bitbucket, Jira, Confluence, Slack, Datadog, PagerDuty, AWS, Google Workspace, Google Cloud,
|
|
250
|
+
Microsoft 365, Databricks, Salesforce, Snowflake, Vault, Azure, Linear and Zendesk.
|
|
251
|
+
|
|
252
|
+
```sh
|
|
253
|
+
pip install toolpass
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Python 3.10 or later. The core depends only on PyYAML. The engine runs in your process, so there is
|
|
257
|
+
no service to deploy; the same package also runs it as a server (`toolpass serve`).
|
|
258
|
+
|
|
259
|
+
### In-process
|
|
260
|
+
|
|
261
|
+
From a toolpass YAML file ([example](https://github.com/roee-hersh/toolpass/blob/main/examples/toolpass.yaml),
|
|
262
|
+
[reference](https://github.com/roee-hersh/toolpass/blob/main/docs/reference/configuration.md)):
|
|
263
|
+
|
|
264
|
+
```python
|
|
265
|
+
from toolpass import Toolpass
|
|
266
|
+
|
|
267
|
+
tp = Toolpass.from_config("toolpass.yaml")
|
|
268
|
+
|
|
269
|
+
d = tp.check("dana@example.com", "jira-main", "DELETE_ISSUES", "issue:PAY-123")
|
|
270
|
+
d.decision # "allow", "deny" or "unknown"
|
|
271
|
+
d.reason # "denied: Dana Levi does not hold DELETE_ISSUES on issue PAY-123"
|
|
272
|
+
d.allowed # True only for allow
|
|
273
|
+
|
|
274
|
+
tp.allowed(...) # True or False
|
|
275
|
+
tp.require(..., fresh=True) # the decision on allow; raises PermissionDenied otherwise
|
|
276
|
+
await tp.acheck(...) # check and require for async code
|
|
277
|
+
await tp.arequire(...)
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Or with the connections in code, as mappings with exactly the keys of the file. A secret key takes
|
|
281
|
+
`toolpass.env("NAME")`, `toolpass.file("/path")`, `toolpass.literal(value)`, or the file's
|
|
282
|
+
`"env:NAME"` and `"file:/path"` strings:
|
|
283
|
+
|
|
284
|
+
```python
|
|
285
|
+
import toolpass
|
|
286
|
+
|
|
287
|
+
tp = toolpass.Toolpass(connections=[
|
|
288
|
+
{"id": "jira-main", "integration": "jira", "url": "https://acme.atlassian.net",
|
|
289
|
+
"username": "toolpass-bot@acme.com", "credential": toolpass.env("JIRA_TOKEN")},
|
|
290
|
+
])
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
`check` never raises for a failed lookup: a timeout, a rejected credential or anything else toolpass
|
|
294
|
+
cannot evaluate is `unknown`. Treat `unknown` exactly like `deny`.
|
|
295
|
+
|
|
296
|
+
### Remote
|
|
297
|
+
|
|
298
|
+
To keep the lookup credentials out of the agent's process, run toolpass as a server (the
|
|
299
|
+
`ghcr.io/roee-hersh/toolpass` image, the Helm chart, or `toolpass serve -config toolpass.yaml`) and
|
|
300
|
+
ask it:
|
|
301
|
+
|
|
302
|
+
```python
|
|
303
|
+
tp = Toolpass.remote("https://toolpass.internal", api_key) # or TOOLPASS_URL and TOOLPASS_API_KEY
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
The methods are the same. The URL must be `https://`, or `http://` on localhost; redirects are not
|
|
307
|
+
followed; a server that cannot be reached is `unknown`.
|
|
308
|
+
|
|
309
|
+
### guarded
|
|
310
|
+
|
|
311
|
+
Puts the check in front of one function, so its body runs only after toolpass said `allow`:
|
|
312
|
+
|
|
313
|
+
```python
|
|
314
|
+
from contextvars import ContextVar
|
|
315
|
+
from toolpass import guarded
|
|
316
|
+
|
|
317
|
+
current_user: ContextVar[str] = ContextVar("current_user") # set from your login, per request
|
|
318
|
+
|
|
319
|
+
@tool # any framework's decorator
|
|
320
|
+
@guarded(tp, "jira-main", "DELETE_ISSUES", "issue:{key}", user=current_user, fresh=True)
|
|
321
|
+
def delete_issue(key: str) -> str:
|
|
322
|
+
jira.delete_issue(key) # the agent's own credential, only after allow
|
|
323
|
+
return f"deleted {key}"
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
The user comes from `user=` (a string, a zero-argument callable or a `ContextVar`), never from the
|
|
327
|
+
call's arguments, so the model cannot choose who it acts as. Anything but `allow` raises
|
|
328
|
+
`PermissionDenied` before the body runs; `deny=` returns a message instead.
|
|
329
|
+
|
|
330
|
+
### Framework adapters
|
|
331
|
+
|
|
332
|
+
Each adapter is configured once on the agent with rules, a tool name to `Rule(connection, action,
|
|
333
|
+
resource)` or a `(connection, action, resource)` tuple, and checks every call to a tool with a rule
|
|
334
|
+
before it runs. A refused call does not run; the model reads `toolpass refused this call: <reason>`
|
|
335
|
+
and the run goes on. The user always comes from the application, never from the model. A tool
|
|
336
|
+
without a rule runs unchecked, unless `strict=True`.
|
|
337
|
+
|
|
338
|
+
**Strands Agents**: an intervention handler; the user from `invocation_state`.
|
|
339
|
+
|
|
340
|
+
```python
|
|
341
|
+
from toolpass.strands import ToolpassAuthorization, Rule
|
|
342
|
+
|
|
343
|
+
guard = ToolpassAuthorization(tp, {"delete_issue": Rule("jira-main", "DELETE_ISSUES", "issue:{key}", fresh=True)})
|
|
344
|
+
agent = Agent(tools=tools, interventions=[guard])
|
|
345
|
+
agent(prompt, invocation_state={"user_id": user.email})
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**LangChain and LangGraph**: agent middleware; the user from the runtime context.
|
|
349
|
+
|
|
350
|
+
```python
|
|
351
|
+
from toolpass.langchain import ToolpassMiddleware, Rule
|
|
352
|
+
|
|
353
|
+
guard = ToolpassMiddleware(tp, {"delete_issue": Rule("jira-main", "DELETE_ISSUES", "issue:{key}")})
|
|
354
|
+
agent = create_agent(model, tools=tools, middleware=[guard], context_schema=Context)
|
|
355
|
+
agent.invoke({"messages": [...]}, context=Context(user_id=user.email))
|
|
356
|
+
# a graph you build yourself: guard.tool_node(tools) is a checked ToolNode
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
**MCP servers** (the `mcp` SDK v2): server middleware; the user from the access token's `email`
|
|
360
|
+
claim, or `user=` for stdio.
|
|
361
|
+
|
|
362
|
+
```python
|
|
363
|
+
from toolpass.mcp import Rule, guard
|
|
364
|
+
|
|
365
|
+
guard(mcp, tp, {"delete_issue": Rule("jira-main", "DELETE_ISSUES", "issue:{key}")})
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**OpenAI Agents SDK**: tool guardrails; the user from the run context's `user_id`.
|
|
369
|
+
|
|
370
|
+
```python
|
|
371
|
+
from toolpass.openai_agents import ToolpassGuardrails, Rule
|
|
372
|
+
|
|
373
|
+
agent = ToolpassGuardrails(tp, {"delete_issue": Rule("jira-main", "DELETE_ISSUES", "issue:{key}")}).apply(agent)
|
|
374
|
+
await Runner.run(agent, prompt, context=RequestContext(user_id=user.email))
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
**Claude Agent SDK**: a `PreToolUse` hook; the user from `user=`. Rules use Claude Code's tool names.
|
|
378
|
+
|
|
379
|
+
```python
|
|
380
|
+
from toolpass.claude_agent_sdk import ToolpassHooks, Rule
|
|
381
|
+
|
|
382
|
+
guard = ToolpassHooks(tp, {"mcp__ops__delete_issue": Rule("jira-main", "DELETE_ISSUES", "issue:{key}")}, user=current_user)
|
|
383
|
+
options = guard.apply(ClaudeAgentOptions(mcp_servers={"ops": server}))
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**Google ADK**: tool callbacks (or `.plugin()` for an `App`); the user is the session's `user_id`.
|
|
387
|
+
|
|
388
|
+
```python
|
|
389
|
+
from toolpass.google_adk import ToolpassCallbacks, Rule
|
|
390
|
+
|
|
391
|
+
agent = ToolpassCallbacks(tp, {"delete_issue": Rule("jira-main", "DELETE_ISSUES", "issue:{key}")}).apply(agent)
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**CrewAI**: process-wide tool-call hooks; the user from the crew's kickoff `inputs`.
|
|
395
|
+
|
|
396
|
+
```python
|
|
397
|
+
from toolpass.crewai import ToolpassHooks, Rule
|
|
398
|
+
|
|
399
|
+
with ToolpassHooks(tp, {"delete_issue": Rule("jira-main", "DELETE_ISSUES", "issue:{key}")}):
|
|
400
|
+
crew.kickoff(inputs={"user_id": user.email})
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
**Pydantic AI**: a capability (or `ToolpassToolset` around one toolset); the user from `deps.user`.
|
|
404
|
+
|
|
405
|
+
```python
|
|
406
|
+
from toolpass.pydantic_ai import ToolpassAuthorization, Rule
|
|
407
|
+
|
|
408
|
+
agent = Agent(model, deps_type=Deps, tools=tools,
|
|
409
|
+
capabilities=[ToolpassAuthorization(tp, {"delete_issue": Rule("jira-main", "DELETE_ISSUES", "issue:{key}")})])
|
|
410
|
+
agent.run_sync(prompt, deps=Deps(user=user.email))
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**LlamaIndex**: wrapped tools; the user from `user=`.
|
|
414
|
+
|
|
415
|
+
```python
|
|
416
|
+
from toolpass.llamaindex import ToolpassAuthorization, Rule
|
|
417
|
+
|
|
418
|
+
guard = ToolpassAuthorization(tp, {"delete_issue": Rule("jira-main", "DELETE_ISSUES", "issue:{key}")}, user=current_user)
|
|
419
|
+
agent = FunctionAgent(tools=guard.wrap(tools), llm=llm)
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
Complete, runnable examples:
|
|
423
|
+
[toolpass-py/examples](https://github.com/roee-hersh/toolpass/tree/main/toolpass-py/examples). Each
|
|
424
|
+
adapter's docstring and the
|
|
425
|
+
[agent guide](https://github.com/roee-hersh/toolpass/blob/main/docs/guides/agent-tools.md) cover
|
|
426
|
+
groups, `strict`, and what each framework does with a refusal.
|
|
427
|
+
|
|
428
|
+
### Extras
|
|
429
|
+
|
|
430
|
+
| Extra | Adds |
|
|
431
|
+
|---|---|
|
|
432
|
+
| `toolpass[crypto]` | `cryptography`, for the integrations that sign with a private key: GitHub App, Google service accounts, Snowflake key pair, Salesforce JWT, Microsoft 365 certificates |
|
|
433
|
+
| `toolpass[strands]` | `strands-agents`, for `toolpass.strands` |
|
|
434
|
+
| `toolpass[langchain]` | `langchain` and `langgraph`, for `toolpass.langchain` |
|
|
435
|
+
| `toolpass[mcp]` | `mcp`, for `toolpass.mcp` |
|
|
436
|
+
| `toolpass[openai-agents]` | `openai-agents`, for `toolpass.openai_agents` |
|
|
437
|
+
| `toolpass[claude-agent-sdk]` | `claude-agent-sdk`, for `toolpass.claude_agent_sdk` |
|
|
438
|
+
| `toolpass[google-adk]` | `google-adk`, for `toolpass.google_adk` |
|
|
439
|
+
| `toolpass[pydantic-ai]` | `pydantic-ai-slim`, for `toolpass.pydantic_ai` |
|
|
440
|
+
| `toolpass[crewai]` | `crewai`, for `toolpass.crewai` |
|
|
441
|
+
| `toolpass[llamaindex]` | `llama-index-core`, for `toolpass.llamaindex` |
|
|
442
|
+
|
|
443
|
+
### The command
|
|
444
|
+
|
|
445
|
+
The package installs `toolpass`:
|
|
446
|
+
|
|
447
|
+
```sh
|
|
448
|
+
toolpass validate -config toolpass.yaml # the file, references, certificates; no network
|
|
449
|
+
toolpass probe -config toolpass.yaml # each connection's credential, live
|
|
450
|
+
toolpass check -config toolpass.yaml -connection jira-main \
|
|
451
|
+
-user dana@example.com -action DELETE_ISSUES -resource issue:PAY-123
|
|
452
|
+
toolpass catalog jira # an integration's keys and actions
|
|
453
|
+
toolpass serve -config toolpass.yaml # POST /check and GET /healthz on :8080
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### More
|
|
457
|
+
|
|
458
|
+
- [Documentation](https://github.com/roee-hersh/toolpass/tree/main/docs), including one page per
|
|
459
|
+
integration with the credential to create.
|
|
460
|
+
- [Architecture and trust boundaries](https://github.com/roee-hersh/toolpass/blob/main/docs/concepts/architecture.md).
|
|
461
|
+
- `toolpass-client` on PyPI, the old Python client, is replaced by this package and gets no new
|
|
462
|
+
releases; installed versions keep working. To move, depend on `toolpass` and change
|
|
463
|
+
`from toolpass_client import Toolpass` / `Toolpass()` to `from toolpass import Toolpass` /
|
|
464
|
+
`Toolpass.remote()` (and `toolpass_client.strands` to `toolpass.strands`).
|
|
465
|
+
|
|
466
|
+
Apache-2.0.
|