osf-agentkit 0.1.1__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.
- osf_agentkit-0.1.1/.gitignore +28 -0
- osf_agentkit-0.1.1/LICENSE +21 -0
- osf_agentkit-0.1.1/PKG-INFO +106 -0
- osf_agentkit-0.1.1/README.md +82 -0
- osf_agentkit-0.1.1/osf_agentkit/__init__.py +10 -0
- osf_agentkit-0.1.1/osf_agentkit/provider.py +197 -0
- osf_agentkit-0.1.1/osf_agentkit/schemas.py +46 -0
- osf_agentkit-0.1.1/pyproject.toml +54 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
*.egg
|
|
9
|
+
|
|
10
|
+
# Virtual environments
|
|
11
|
+
.venv/
|
|
12
|
+
venv/
|
|
13
|
+
env/
|
|
14
|
+
|
|
15
|
+
# Tooling / IDE
|
|
16
|
+
.mypy_cache/
|
|
17
|
+
.ruff_cache/
|
|
18
|
+
.pytest_cache/
|
|
19
|
+
.idea/
|
|
20
|
+
.vscode/
|
|
21
|
+
|
|
22
|
+
# OS
|
|
23
|
+
.DS_Store
|
|
24
|
+
Thumbs.db
|
|
25
|
+
|
|
26
|
+
# Secrets / env
|
|
27
|
+
.env
|
|
28
|
+
*.pem
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Corey Gallant / OSF (Open Source Filings)
|
|
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.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: osf-agentkit
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Coinbase AgentKit action provider for OSF (Open Source Filings): provenance-stamped sanctions, entity, and CVE data for AI agents, paid per call over x402 (USDC on Base).
|
|
5
|
+
Project-URL: Homepage, https://api.osf-master-server.com
|
|
6
|
+
Project-URL: Source, https://github.com/onefreeman1337/osf-agentkit
|
|
7
|
+
Author: Corey Gallant
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: agentkit,ai-agents,coinbase,cve,entity-resolution,kyb,kyc,ofac,provenance,sanctions,x402
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
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: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Requires-Dist: coinbase-agentkit>=0.7.0
|
|
21
|
+
Requires-Dist: solana<0.40,>=0.36.6
|
|
22
|
+
Requires-Dist: x402<2.0.0,>=1.0.0
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# osf-agentkit
|
|
26
|
+
|
|
27
|
+
A [Coinbase AgentKit](https://github.com/coinbase/agentkit) action provider that gives AI agents three provenance-stamped "ground truth" tools, paid per call over [x402](https://docs.cdp.coinbase.com/x402) (USDC on Base):
|
|
28
|
+
|
|
29
|
+
| Action | Input | Returns | Price |
|
|
30
|
+
| --- | --- | --- | --- |
|
|
31
|
+
| `OSF_lookup_entity` | a company/person name or an identifier (NPI, LEI, FDIC cert, SEC CIK) | legal name, status, type, jurisdiction, identifiers, and a **provenance URL** to the official registry | $0.01 |
|
|
32
|
+
| `OSF_screen_entity` | a name | hit / no-hit against OFAC SDN, EU, and UK sanctions lists, with matched list, provenance URL, and an **audit receipt** | $0.05 |
|
|
33
|
+
| `OSF_check_cve_exploited` | a CVE id | CISA KEV actively-exploited status, EPSS score, CVSS severity, each with a **provenance URL** | $0.02 |
|
|
34
|
+
|
|
35
|
+
Every answer carries a link back to the authoritative primary source (US CMS NPI, GLEIF, FDIC, SEC EDGAR, OFAC, CISA), so an agent can **justify a decision to an auditor or regulator** instead of citing an opaque API. Payment is automatic and per-request: no API keys, no accounts, no subscriptions.
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install osf-agentkit
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Quickstart (AgentKit)
|
|
44
|
+
|
|
45
|
+
Add the provider to your AgentKit config. The agent pays for each call from its own wallet, so you need an `EvmWalletProvider` funded with USDC on **Base mainnet**.
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from coinbase_agentkit import AgentKit, AgentKitConfig
|
|
49
|
+
from osf_agentkit import osf_action_provider
|
|
50
|
+
|
|
51
|
+
agent_kit = AgentKit(AgentKitConfig(
|
|
52
|
+
wallet_provider=your_evm_wallet_provider, # e.g. a CDP EVM wallet on base-mainnet
|
|
53
|
+
action_providers=[
|
|
54
|
+
osf_action_provider(),
|
|
55
|
+
# ... your other providers
|
|
56
|
+
],
|
|
57
|
+
))
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The agent now has `OSF_lookup_entity`, `OSF_screen_entity`, and `OSF_check_cve_exploited` available. See the [AgentKit docs](https://docs.cdp.coinbase.com/agent-kit/welcome) for wallet-provider setup.
|
|
61
|
+
|
|
62
|
+
## Use with LangChain
|
|
63
|
+
|
|
64
|
+
AgentKit actions convert to LangChain tools via the LangChain extension:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install coinbase-agentkit-langchain
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from coinbase_agentkit_langchain import get_langchain_tools
|
|
72
|
+
|
|
73
|
+
tools = get_langchain_tools(agent_kit) # includes the three OSF tools
|
|
74
|
+
# pass `tools` to your LangChain / LangGraph agent
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Wallet, network, and spend caps
|
|
78
|
+
|
|
79
|
+
- **Network:** OSF settles on **Base mainnet** only. `supports_network` returns `False` for other networks, so the actions simply won't be offered off Base.
|
|
80
|
+
- **Funding:** the agent's wallet needs USDC on Base to pay per call.
|
|
81
|
+
- **Per-call spend ceilings** (atomic USDC, protective; the client refuses to pay more):
|
|
82
|
+
- `lookup_entity` — $0.05
|
|
83
|
+
- `screen_entity` — $0.15
|
|
84
|
+
- `check_cve_exploited` — $0.10
|
|
85
|
+
|
|
86
|
+
These sit above OSF's list prices so a small price change won't break calls, while capping runaway spend. If OSF ever reprices above a ceiling, bump the constants in `provider.py`.
|
|
87
|
+
|
|
88
|
+
## Configuration
|
|
89
|
+
|
|
90
|
+
Point the provider at a different base URL (e.g. for testing) if needed:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
osf_action_provider(base_url="https://api.osf-master-server.com/x402")
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## How it works
|
|
97
|
+
|
|
98
|
+
Each action makes a single paid `GET` to the corresponding OSF endpoint using `x402_requests(wallet_provider.to_signer(), max_value=<cap>)`. When OSF replies `402 Payment Required`, the x402 client signs and settles the micropayment with the agent's wallet, then retries — all transparently. The action returns the JSON result plus the on-chain payment proof.
|
|
99
|
+
|
|
100
|
+
## About OSF
|
|
101
|
+
|
|
102
|
+
OSF (Open Source Filings) sells provenance-stamped US public-domain government and scientific data to autonomous agents over x402. Learn more at [api.osf-master-server.com](https://api.osf-master-server.com).
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# osf-agentkit
|
|
2
|
+
|
|
3
|
+
A [Coinbase AgentKit](https://github.com/coinbase/agentkit) action provider that gives AI agents three provenance-stamped "ground truth" tools, paid per call over [x402](https://docs.cdp.coinbase.com/x402) (USDC on Base):
|
|
4
|
+
|
|
5
|
+
| Action | Input | Returns | Price |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| `OSF_lookup_entity` | a company/person name or an identifier (NPI, LEI, FDIC cert, SEC CIK) | legal name, status, type, jurisdiction, identifiers, and a **provenance URL** to the official registry | $0.01 |
|
|
8
|
+
| `OSF_screen_entity` | a name | hit / no-hit against OFAC SDN, EU, and UK sanctions lists, with matched list, provenance URL, and an **audit receipt** | $0.05 |
|
|
9
|
+
| `OSF_check_cve_exploited` | a CVE id | CISA KEV actively-exploited status, EPSS score, CVSS severity, each with a **provenance URL** | $0.02 |
|
|
10
|
+
|
|
11
|
+
Every answer carries a link back to the authoritative primary source (US CMS NPI, GLEIF, FDIC, SEC EDGAR, OFAC, CISA), so an agent can **justify a decision to an auditor or regulator** instead of citing an opaque API. Payment is automatic and per-request: no API keys, no accounts, no subscriptions.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install osf-agentkit
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quickstart (AgentKit)
|
|
20
|
+
|
|
21
|
+
Add the provider to your AgentKit config. The agent pays for each call from its own wallet, so you need an `EvmWalletProvider` funded with USDC on **Base mainnet**.
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from coinbase_agentkit import AgentKit, AgentKitConfig
|
|
25
|
+
from osf_agentkit import osf_action_provider
|
|
26
|
+
|
|
27
|
+
agent_kit = AgentKit(AgentKitConfig(
|
|
28
|
+
wallet_provider=your_evm_wallet_provider, # e.g. a CDP EVM wallet on base-mainnet
|
|
29
|
+
action_providers=[
|
|
30
|
+
osf_action_provider(),
|
|
31
|
+
# ... your other providers
|
|
32
|
+
],
|
|
33
|
+
))
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The agent now has `OSF_lookup_entity`, `OSF_screen_entity`, and `OSF_check_cve_exploited` available. See the [AgentKit docs](https://docs.cdp.coinbase.com/agent-kit/welcome) for wallet-provider setup.
|
|
37
|
+
|
|
38
|
+
## Use with LangChain
|
|
39
|
+
|
|
40
|
+
AgentKit actions convert to LangChain tools via the LangChain extension:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install coinbase-agentkit-langchain
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from coinbase_agentkit_langchain import get_langchain_tools
|
|
48
|
+
|
|
49
|
+
tools = get_langchain_tools(agent_kit) # includes the three OSF tools
|
|
50
|
+
# pass `tools` to your LangChain / LangGraph agent
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Wallet, network, and spend caps
|
|
54
|
+
|
|
55
|
+
- **Network:** OSF settles on **Base mainnet** only. `supports_network` returns `False` for other networks, so the actions simply won't be offered off Base.
|
|
56
|
+
- **Funding:** the agent's wallet needs USDC on Base to pay per call.
|
|
57
|
+
- **Per-call spend ceilings** (atomic USDC, protective; the client refuses to pay more):
|
|
58
|
+
- `lookup_entity` — $0.05
|
|
59
|
+
- `screen_entity` — $0.15
|
|
60
|
+
- `check_cve_exploited` — $0.10
|
|
61
|
+
|
|
62
|
+
These sit above OSF's list prices so a small price change won't break calls, while capping runaway spend. If OSF ever reprices above a ceiling, bump the constants in `provider.py`.
|
|
63
|
+
|
|
64
|
+
## Configuration
|
|
65
|
+
|
|
66
|
+
Point the provider at a different base URL (e.g. for testing) if needed:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
osf_action_provider(base_url="https://api.osf-master-server.com/x402")
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## How it works
|
|
73
|
+
|
|
74
|
+
Each action makes a single paid `GET` to the corresponding OSF endpoint using `x402_requests(wallet_provider.to_signer(), max_value=<cap>)`. When OSF replies `402 Payment Required`, the x402 client signs and settles the micropayment with the agent's wallet, then retries — all transparently. The action returns the JSON result plus the on-chain payment proof.
|
|
75
|
+
|
|
76
|
+
## About OSF
|
|
77
|
+
|
|
78
|
+
OSF (Open Source Filings) sells provenance-stamped US public-domain government and scientific data to autonomous agents over x402. Learn more at [api.osf-master-server.com](https://api.osf-master-server.com).
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""OSF action provider for Coinbase AgentKit.
|
|
2
|
+
|
|
3
|
+
Provenance-stamped sanctions, entity, and CVE data for AI agents, paid per call
|
|
4
|
+
over x402 (USDC on Base mainnet).
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .provider import OSF, OsfActionProvider, osf_action_provider
|
|
8
|
+
|
|
9
|
+
__all__ = ["OSF", "OsfActionProvider", "osf_action_provider"]
|
|
10
|
+
__version__ = "0.1.1"
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"""OSF (Open Source Filings) action provider for Coinbase AgentKit.
|
|
2
|
+
|
|
3
|
+
Gives an AgentKit agent three provenance-stamped "ground truth" tools, each paid
|
|
4
|
+
per call over x402 (USDC on Base mainnet) using the agent's own EVM wallet:
|
|
5
|
+
|
|
6
|
+
* lookup_entity - resolve a company/person against authoritative public
|
|
7
|
+
registries (CMS NPI, GLEIF LEI, FDIC, SEC EDGAR)
|
|
8
|
+
* screen_entity - sanctions/watchlist screening by name (OFAC SDN, EU, UK)
|
|
9
|
+
* check_cve_exploited - is a CVE actively exploited (CISA KEV / EPSS / CVSS)
|
|
10
|
+
|
|
11
|
+
Every result carries a provenance URL back to the authoritative primary source
|
|
12
|
+
(and, for sanctions, an audit receipt), so an agent can justify a decision to an
|
|
13
|
+
auditor or regulator.
|
|
14
|
+
|
|
15
|
+
Payment is automatic: when an OSF endpoint replies 402, the x402 client signs and
|
|
16
|
+
settles the micropayment with the agent's wallet, then retries. Each action is
|
|
17
|
+
bounded by a per-call spend ceiling so a mispriced or hostile endpoint cannot
|
|
18
|
+
drain the wallet.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
import json
|
|
24
|
+
from typing import Any
|
|
25
|
+
from urllib.parse import quote
|
|
26
|
+
|
|
27
|
+
from x402.clients.base import decode_x_payment_response
|
|
28
|
+
from x402.clients.requests import x402_requests
|
|
29
|
+
|
|
30
|
+
from coinbase_agentkit.action_providers.action_provider import ActionProvider
|
|
31
|
+
from coinbase_agentkit.action_providers.action_decorator import create_action
|
|
32
|
+
from coinbase_agentkit.network import Network
|
|
33
|
+
from coinbase_agentkit.wallet_providers.evm_wallet_provider import EvmWalletProvider
|
|
34
|
+
|
|
35
|
+
from .schemas import (
|
|
36
|
+
CheckCveExploitedSchema,
|
|
37
|
+
LookupEntitySchema,
|
|
38
|
+
ScreenEntitySchema,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# OSF settles on Base mainnet only.
|
|
42
|
+
SUPPORTED_NETWORKS = ["base-mainnet"]
|
|
43
|
+
|
|
44
|
+
DEFAULT_BASE_URL = "https://api.osf-master-server.com/x402"
|
|
45
|
+
|
|
46
|
+
# Per-action spend ceilings in atomic USDC (6 decimals: 1_000_000 = $1.00).
|
|
47
|
+
# Headroom over OSF's live prices (entity $0.01, sanctions $0.05, cve $0.02) so a
|
|
48
|
+
# modest price change does not break calls, while capping runaway spend. The
|
|
49
|
+
# x402 client refuses to pay more than this for the call.
|
|
50
|
+
_MAX_ENTITY_ATOMIC = 50_000 # $0.05 ceiling
|
|
51
|
+
_MAX_SCREEN_ATOMIC = 150_000 # $0.15 ceiling
|
|
52
|
+
_MAX_CVE_ATOMIC = 100_000 # $0.10 ceiling
|
|
53
|
+
|
|
54
|
+
_TIMEOUT_SECONDS = 30
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class OSF(ActionProvider[EvmWalletProvider]):
|
|
58
|
+
"""Paid access to OSF provenance-stamped government and scientific data.
|
|
59
|
+
|
|
60
|
+
Note: AgentKit derives each agent-facing action name as ``{ClassName}_{method}``,
|
|
61
|
+
so this class is named ``OSF`` to yield clean tool names like ``OSF_lookup_entity``.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
def __init__(self, base_url: str = DEFAULT_BASE_URL) -> None:
|
|
65
|
+
super().__init__("osf", [])
|
|
66
|
+
self._base_url = base_url.rstrip("/")
|
|
67
|
+
|
|
68
|
+
def supports_network(self, network: Network) -> bool:
|
|
69
|
+
"""OSF endpoints settle on Base mainnet."""
|
|
70
|
+
return network.network_id in SUPPORTED_NETWORKS
|
|
71
|
+
|
|
72
|
+
# ------------------------------------------------------------------ #
|
|
73
|
+
# internal: a single paid GET with automatic x402 settlement
|
|
74
|
+
# ------------------------------------------------------------------ #
|
|
75
|
+
def _paid_get(
|
|
76
|
+
self,
|
|
77
|
+
wallet_provider: EvmWalletProvider,
|
|
78
|
+
path: str,
|
|
79
|
+
max_value_atomic: int,
|
|
80
|
+
) -> str:
|
|
81
|
+
try:
|
|
82
|
+
account = wallet_provider.to_signer()
|
|
83
|
+
session = x402_requests(account, max_value=max_value_atomic)
|
|
84
|
+
url = f"{self._base_url}{path}"
|
|
85
|
+
response = session.request(url=url, method="GET", timeout=_TIMEOUT_SECONDS)
|
|
86
|
+
|
|
87
|
+
payment = None
|
|
88
|
+
if "x-payment-response" in response.headers:
|
|
89
|
+
try:
|
|
90
|
+
proof = decode_x_payment_response(response.headers["x-payment-response"])
|
|
91
|
+
payment = {
|
|
92
|
+
"transaction": proof.get("transaction"),
|
|
93
|
+
"network": proof.get("network"),
|
|
94
|
+
"payer": proof.get("payer"),
|
|
95
|
+
}
|
|
96
|
+
except Exception:
|
|
97
|
+
payment = None
|
|
98
|
+
|
|
99
|
+
is_json = "application/json" in response.headers.get("content-type", "")
|
|
100
|
+
data = response.json() if is_json else response.text
|
|
101
|
+
|
|
102
|
+
out: dict[str, Any] = {
|
|
103
|
+
"success": response.status_code == 200,
|
|
104
|
+
"status": response.status_code,
|
|
105
|
+
"data": data,
|
|
106
|
+
}
|
|
107
|
+
if payment:
|
|
108
|
+
out["payment"] = payment
|
|
109
|
+
return json.dumps(out, indent=2)
|
|
110
|
+
|
|
111
|
+
except Exception as error: # noqa: BLE001 - surface a clean message to the agent
|
|
112
|
+
return json.dumps(
|
|
113
|
+
{
|
|
114
|
+
"success": False,
|
|
115
|
+
"error": str(error),
|
|
116
|
+
"hint": (
|
|
117
|
+
"Check the agent wallet holds USDC on Base mainnet and that "
|
|
118
|
+
"the per-call spend ceiling is high enough for the endpoint price."
|
|
119
|
+
),
|
|
120
|
+
},
|
|
121
|
+
indent=2,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
# ------------------------------------------------------------------ #
|
|
125
|
+
# actions
|
|
126
|
+
# ------------------------------------------------------------------ #
|
|
127
|
+
@create_action(
|
|
128
|
+
name="lookup_entity",
|
|
129
|
+
description=(
|
|
130
|
+
"Resolve and verify a company or person against authoritative public "
|
|
131
|
+
"registries: US healthcare providers (CMS NPI), global legal entities "
|
|
132
|
+
"(GLEIF LEI), US banks (FDIC), and SEC filers / public companies (EDGAR "
|
|
133
|
+
"CIK). Pass an identifier (NPI, LEI, FDIC cert, or CIK) for an exact "
|
|
134
|
+
"match, or a name for candidate matches. Returns legal name, status, "
|
|
135
|
+
"type, jurisdiction, key identifiers, and a provenance URL to the official "
|
|
136
|
+
"source. Use for KYC, KYB, counterparty due-diligence, provider "
|
|
137
|
+
"verification, and onboarding. Costs a small USDC micropayment per call "
|
|
138
|
+
"(paid automatically via x402 on Base)."
|
|
139
|
+
),
|
|
140
|
+
schema=LookupEntitySchema,
|
|
141
|
+
)
|
|
142
|
+
def lookup_entity(self, wallet_provider: EvmWalletProvider, args: dict[str, Any]) -> str:
|
|
143
|
+
"""Resolve an entity by identifier or name against public registries."""
|
|
144
|
+
q = quote(str(args["query"]), safe="")
|
|
145
|
+
return self._paid_get(wallet_provider, f"/identity/entity/{q}", _MAX_ENTITY_ATOMIC)
|
|
146
|
+
|
|
147
|
+
@create_action(
|
|
148
|
+
name="screen_entity",
|
|
149
|
+
description=(
|
|
150
|
+
"Sanctions and compliance screening of a single name against the OFAC SDN, "
|
|
151
|
+
"EU consolidated, and UK OFSI sanctions lists. Returns hit or no-hit, the "
|
|
152
|
+
"matched list, a provenance URL, and an audit receipt. Use for AML, KYC, "
|
|
153
|
+
"watchlist, and OFAC compliance checks before moving money or onboarding a "
|
|
154
|
+
"counterparty. Costs a small USDC micropayment per call (paid automatically "
|
|
155
|
+
"via x402 on Base)."
|
|
156
|
+
),
|
|
157
|
+
schema=ScreenEntitySchema,
|
|
158
|
+
)
|
|
159
|
+
def screen_entity(self, wallet_provider: EvmWalletProvider, args: dict[str, Any]) -> str:
|
|
160
|
+
"""Screen a name against OFAC/EU/UK sanctions lists."""
|
|
161
|
+
n = quote(str(args["name"]), safe="")
|
|
162
|
+
return self._paid_get(wallet_provider, f"/screen/sanctions/{n}", _MAX_SCREEN_ATOMIC)
|
|
163
|
+
|
|
164
|
+
@create_action(
|
|
165
|
+
name="check_cve_exploited",
|
|
166
|
+
description=(
|
|
167
|
+
"Check whether a CVE is being actively exploited in the wild. Returns its "
|
|
168
|
+
"presence on the US CISA Known Exploited Vulnerabilities (KEV) catalog, its "
|
|
169
|
+
"EPSS exploit-probability score, and its CVSS severity, each with a "
|
|
170
|
+
"provenance URL to the authoritative US government source. Use for "
|
|
171
|
+
"vulnerability management, patch prioritization, threat intelligence, and "
|
|
172
|
+
"DevSecOps triage. Costs a small USDC micropayment per call (paid "
|
|
173
|
+
"automatically via x402 on Base)."
|
|
174
|
+
),
|
|
175
|
+
schema=CheckCveExploitedSchema,
|
|
176
|
+
)
|
|
177
|
+
def check_cve_exploited(self, wallet_provider: EvmWalletProvider, args: dict[str, Any]) -> str:
|
|
178
|
+
"""Check whether a CVE is on CISA KEV / its EPSS + CVSS scores."""
|
|
179
|
+
c = quote(str(args["cve_id"]), safe="")
|
|
180
|
+
return self._paid_get(wallet_provider, f"/security/cve/{c}", _MAX_CVE_ATOMIC)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def osf_action_provider(base_url: str = DEFAULT_BASE_URL) -> "OSF":
|
|
184
|
+
"""Create an OSF action provider (AgentKit factory convention).
|
|
185
|
+
|
|
186
|
+
Args:
|
|
187
|
+
base_url: Override the OSF base URL (defaults to the public mainnet API).
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
An OSF provider exposing lookup_entity, screen_entity, and
|
|
191
|
+
check_cve_exploited (surfaced to the agent as OSF_lookup_entity, etc.).
|
|
192
|
+
"""
|
|
193
|
+
return OSF(base_url=base_url)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
# Backward-compatible alias.
|
|
197
|
+
OsfActionProvider = OSF
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Argument schemas for the OSF AgentKit action provider.
|
|
2
|
+
|
|
3
|
+
Each schema documents the single input an agent must supply. The field
|
|
4
|
+
descriptions are written for an LLM planner: concrete, example-bearing, and
|
|
5
|
+
matched to how an agent would phrase the task.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, Field
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class LookupEntitySchema(BaseModel):
|
|
12
|
+
"""Resolve a company or person against authoritative public registries."""
|
|
13
|
+
|
|
14
|
+
query: str = Field(
|
|
15
|
+
...,
|
|
16
|
+
description=(
|
|
17
|
+
"An entity identifier for an exact match, OR a company/person name for "
|
|
18
|
+
"candidate matches. Accepted identifiers: US healthcare provider NPI "
|
|
19
|
+
"(10 digits), GLEIF LEI (20 chars), FDIC certificate number, or SEC EDGAR "
|
|
20
|
+
"CIK. Examples: 'Apple Inc', '254900XAWYYH4QOUWQ70' (LEI), '1174150262' (NPI)."
|
|
21
|
+
),
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ScreenEntitySchema(BaseModel):
|
|
26
|
+
"""Sanctions/watchlist screening of a single name."""
|
|
27
|
+
|
|
28
|
+
name: str = Field(
|
|
29
|
+
...,
|
|
30
|
+
description=(
|
|
31
|
+
"Full name of the person or entity to screen against the OFAC SDN, EU "
|
|
32
|
+
"consolidated, and UK OFSI sanctions lists. Example: 'Vladimir Putin'."
|
|
33
|
+
),
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class CheckCveExploitedSchema(BaseModel):
|
|
38
|
+
"""Check whether a CVE is actively exploited."""
|
|
39
|
+
|
|
40
|
+
cve_id: str = Field(
|
|
41
|
+
...,
|
|
42
|
+
description=(
|
|
43
|
+
"A CVE identifier in canonical form 'CVE-YYYY-NNNN' (4+ digits in the "
|
|
44
|
+
"sequence number). Example: 'CVE-2021-44228' (Log4Shell)."
|
|
45
|
+
),
|
|
46
|
+
)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "osf-agentkit"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "Coinbase AgentKit action provider for OSF (Open Source Filings): provenance-stamped sanctions, entity, and CVE data for AI agents, paid per call over x402 (USDC on Base)."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Corey Gallant" }]
|
|
13
|
+
keywords = [
|
|
14
|
+
"x402",
|
|
15
|
+
"agentkit",
|
|
16
|
+
"coinbase",
|
|
17
|
+
"ai-agents",
|
|
18
|
+
"sanctions",
|
|
19
|
+
"ofac",
|
|
20
|
+
"kyb",
|
|
21
|
+
"kyc",
|
|
22
|
+
"cve",
|
|
23
|
+
"entity-resolution",
|
|
24
|
+
"provenance",
|
|
25
|
+
]
|
|
26
|
+
classifiers = [
|
|
27
|
+
"Development Status :: 4 - Beta",
|
|
28
|
+
"Intended Audience :: Developers",
|
|
29
|
+
"License :: OSI Approved :: MIT License",
|
|
30
|
+
"Programming Language :: Python :: 3",
|
|
31
|
+
"Programming Language :: Python :: 3.10",
|
|
32
|
+
"Programming Language :: Python :: 3.11",
|
|
33
|
+
"Programming Language :: Python :: 3.12",
|
|
34
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
35
|
+
]
|
|
36
|
+
dependencies = [
|
|
37
|
+
"coinbase-agentkit>=0.7.0",
|
|
38
|
+
"x402>=1.0.0,<2.0.0",
|
|
39
|
+
# coinbase-agentkit imports the synchronous solana.rpc.api.Client, which was
|
|
40
|
+
# removed in solana 0.40.0. cdp-sdk / coinbase-agentkit only require
|
|
41
|
+
# solana>=0.36.6 (no upper bound), so a fresh install otherwise pulls 0.40.0
|
|
42
|
+
# and fails to import. Cap solana below 0.40 so the package imports cleanly.
|
|
43
|
+
"solana>=0.36.6,<0.40",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[project.urls]
|
|
47
|
+
Homepage = "https://api.osf-master-server.com"
|
|
48
|
+
Source = "https://github.com/onefreeman1337/osf-agentkit"
|
|
49
|
+
|
|
50
|
+
[tool.hatch.build.targets.wheel]
|
|
51
|
+
packages = ["osf_agentkit"]
|
|
52
|
+
|
|
53
|
+
[tool.hatch.build.targets.sdist]
|
|
54
|
+
include = ["osf_agentkit", "README.md", "LICENSE"]
|