agent-security-gate-x402 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent_security_gate_x402-1.1.0/.well-known/ap2.json +37 -0
- agent_security_gate_x402-1.1.0/LICENSE +21 -0
- agent_security_gate_x402-1.1.0/MANIFEST.in +10 -0
- agent_security_gate_x402-1.1.0/PKG-INFO +232 -0
- agent_security_gate_x402-1.1.0/README.md +196 -0
- agent_security_gate_x402-1.1.0/agent_security_gate_x402.egg-info/PKG-INFO +232 -0
- agent_security_gate_x402-1.1.0/agent_security_gate_x402.egg-info/SOURCES.txt +37 -0
- agent_security_gate_x402-1.1.0/agent_security_gate_x402.egg-info/dependency_links.txt +1 -0
- agent_security_gate_x402-1.1.0/agent_security_gate_x402.egg-info/entry_points.txt +4 -0
- agent_security_gate_x402-1.1.0/agent_security_gate_x402.egg-info/requires.txt +14 -0
- agent_security_gate_x402-1.1.0/agent_security_gate_x402.egg-info/top_level.txt +3 -0
- agent_security_gate_x402-1.1.0/app/__init__.py +2 -0
- agent_security_gate_x402-1.1.0/app/agrid_finance_legal.py +172 -0
- agent_security_gate_x402-1.1.0/app/enterprise_manager.py +90 -0
- agent_security_gate_x402-1.1.0/app/main.py +655 -0
- agent_security_gate_x402-1.1.0/app/multi_chain.py +56 -0
- agent_security_gate_x402-1.1.0/app/onchain_signer.py +124 -0
- agent_security_gate_x402-1.1.0/app/schemas.py +210 -0
- agent_security_gate_x402-1.1.0/app/security_engine.py +337 -0
- agent_security_gate_x402-1.1.0/app/static/index.html +903 -0
- agent_security_gate_x402-1.1.0/app/vault_manager.py +195 -0
- agent_security_gate_x402-1.1.0/app/x402_verifier.py +206 -0
- agent_security_gate_x402-1.1.0/contracts/AgentSecurityVault.sol +64 -0
- agent_security_gate_x402-1.1.0/contracts/SecurityGateConsumer.sol +99 -0
- agent_security_gate_x402-1.1.0/glama.json +39 -0
- agent_security_gate_x402-1.1.0/llms.txt +39 -0
- agent_security_gate_x402-1.1.0/mcp_server.py +276 -0
- agent_security_gate_x402-1.1.0/mcp_tool_spec.json +80 -0
- agent_security_gate_x402-1.1.0/pyproject.toml +81 -0
- agent_security_gate_x402-1.1.0/sdk/__init__.py +22 -0
- agent_security_gate_x402-1.1.0/sdk/agent_gate_sdk.py +340 -0
- agent_security_gate_x402-1.1.0/sdk/integrations.py +118 -0
- agent_security_gate_x402-1.1.0/setup.cfg +4 -0
- agent_security_gate_x402-1.1.0/tests/test_client.py +462 -0
- agent_security_gate_x402-1.1.0/tests/test_high_throughput_m2m.py +123 -0
- agent_security_gate_x402-1.1.0/tests/test_onchain_binding.py +76 -0
- agent_security_gate_x402-1.1.0/tests/test_phase1_upgrades.py +60 -0
- agent_security_gate_x402-1.1.0/tests/test_phase2_multichain.py +34 -0
- agent_security_gate_x402-1.1.0/tests/test_phase3_enterprise.py +52 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "AP2/1.0",
|
|
3
|
+
"service": "Agent Output Security & Hallucination Gate",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Deterministic, ultra-low latency (<10ms) security, prompt injection, secret key leak, dangerous AST code, and factual hallucination inspection micro-oracle for autonomous agents.",
|
|
6
|
+
"supported_rails": [
|
|
7
|
+
"x402-polygon-usdc"
|
|
8
|
+
],
|
|
9
|
+
"pricing": {
|
|
10
|
+
"amount": "0.002",
|
|
11
|
+
"currency": "USDC",
|
|
12
|
+
"network": "polygon",
|
|
13
|
+
"chain_id": 137,
|
|
14
|
+
"asset_contract": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"
|
|
15
|
+
},
|
|
16
|
+
"capabilities": [
|
|
17
|
+
{
|
|
18
|
+
"action": "inspect_agent_output",
|
|
19
|
+
"endpoint": "/api/v1/inspect",
|
|
20
|
+
"method": "POST",
|
|
21
|
+
"description": "Ultra-low latency security, key leak, and factual hallucination validator for 0.002 USDC on Polygon."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"action": "mcp_tool_invoke",
|
|
25
|
+
"endpoint": "/mcp/invoke",
|
|
26
|
+
"method": "POST",
|
|
27
|
+
"description": "Direct JSON-RPC standard MCP tool dispatcher with x402 payment validation."
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
|
|
31
|
+
"security_checks": [
|
|
32
|
+
"prompt_injection_guard",
|
|
33
|
+
"secret_private_key_leak_scanner",
|
|
34
|
+
"dangerous_ast_execution_guard",
|
|
35
|
+
"numerical_and_entity_faithfulness_nli"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 nohosa001-pixel
|
|
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,10 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include glama.json
|
|
4
|
+
include mcp_tool_spec.json
|
|
5
|
+
include llms.txt
|
|
6
|
+
recursive-include .well-known *
|
|
7
|
+
recursive-include app/static *
|
|
8
|
+
recursive-include contracts *
|
|
9
|
+
recursive-include sdk *
|
|
10
|
+
global-exclude *.py[cod] __pycache__ *.so
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-security-gate-x402
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Ultra-low latency (<10ms) deterministic security, prompt injection, secret leak, dangerous AST, and factual hallucination inspection micro-oracle for autonomous agents on Polygon, Base, and Arbitrum.
|
|
5
|
+
Author-email: Security Gate Team <developer@security-gate-x402.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/nohosa001-pixel/security-gate-x402
|
|
8
|
+
Project-URL: Repository, https://github.com/nohosa001-pixel/security-gate-x402
|
|
9
|
+
Keywords: ai-agents,security,guardrails,hallucination,x402,attestation,polygon,base,arbitrum,mcp,glama,fastapi
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: Information Technology
|
|
13
|
+
Classifier: Topic :: Security
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: fastapi>=0.110.0
|
|
23
|
+
Requires-Dist: uvicorn>=0.28.0
|
|
24
|
+
Requires-Dist: pydantic>=2.6.0
|
|
25
|
+
Requires-Dist: pydantic-settings>=2.2.0
|
|
26
|
+
Requires-Dist: httpx>=0.27.0
|
|
27
|
+
Requires-Dist: web3>=6.15.0
|
|
28
|
+
Requires-Dist: eth-account>=0.11.0
|
|
29
|
+
Requires-Dist: cryptography>=42.0.0
|
|
30
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
31
|
+
Requires-Dist: mcp>=1.0.0
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# Agent Output Security & Hallucination Gate (`agent-security-gate-x402`) ๐ก๏ธโก
|
|
38
|
+
|
|
39
|
+
[](https://pypi.org/project/agent-security-gate-x402/)
|
|
40
|
+
[](https://glama.ai/mcp/servers/nohosa001-pixel/agent-security-gate-x402)
|
|
41
|
+
[](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/)
|
|
42
|
+
[](https://polygon.technology)
|
|
43
|
+
[](https://fastapi.tiangolo.com)
|
|
44
|
+
[](https://opensource.org/licenses/MIT)
|
|
45
|
+
|
|
46
|
+
> **Ultra-low latency (<10ms) deterministic security, prompt injection, secret key leak, dangerous AST code, and factual hallucination inspection micro-oracle with EIP-191 & EIP-712 cryptographic attestations on Polygon, Base, and Arbitrum.**
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## ๐ฅ๏ธ Interactive Web Dashboard & Simulator (Live)
|
|
51
|
+
|
|
52
|
+
๐ **[https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/)**
|
|
53
|
+
|
|
54
|
+
Explore the full consumer and enterprise visual interface directly in your browser:
|
|
55
|
+
- ๐ก๏ธ **Prompt Injection & Jailbreak Radar**: Live testing against DAN prompts, system tag escapes, and adversarial suffixes.
|
|
56
|
+
- โก **Dangerous AST Code Analyzer**: Sub-millisecond Python syntax parsing detecting `os.system`, `subprocess`, `eval`, `exec`, and malicious sockets.
|
|
57
|
+
- ๐ **Hallucination & NLI Fact-Checker**: Contrast agent generation with ground truth context to surface fabricated numbers and unanchored claims.
|
|
58
|
+
- ๐ **EIP-712 On-Chain Attestation & Calldata**: Instant generation of `v, r, s` ABI calldata for EVM smart contracts.
|
|
59
|
+
- ๐ก **Real-Time Security Event Stream**: Live WebSocket event feed of inspection audits.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## ๐ Live Service Links & Resources
|
|
64
|
+
|
|
65
|
+
| Service / Endpoint | Description | URL Link |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| ๐ฅ๏ธ **Web Dashboard** | Interactive visual UI, security simulator & audit tester | [Launch Dashboard](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/dashboard) |
|
|
68
|
+
| โก **API Playground** | Browser-based interactive query sandbox | [Open Playground](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/playground) |
|
|
69
|
+
| ๐ก๏ธ **Live Inspection** | Core deterministic security & NLI hallucination check | [`/inspect`](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/inspect) |
|
|
70
|
+
| ๐ **On-Chain Calldata** | EIP-712 smart contract attestation calldata endpoint | [`/api/v1/gate/attestation/onchain`](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/api/v1/gate/attestation/onchain) |
|
|
71
|
+
| ๐ **Swagger API Docs** | Full interactive OpenAPI documentation | [View Swagger Docs](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/docs) |
|
|
72
|
+
| ๐ค **LLM Agent Manifest** | Machine-readable tool specifications | [`/llms.txt`](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/llms.txt) |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## โก 1-Click MCP Integration (Claude Desktop & Cursor)
|
|
77
|
+
|
|
78
|
+
Connect to Claude Desktop, Cursor, Gemini, or any Model Context Protocol client instantly:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"mcpServers": {
|
|
83
|
+
"security-gate-x402": {
|
|
84
|
+
"command": "uvx",
|
|
85
|
+
"args": ["agent-security-gate-x402"]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## ๐ Core Services & Capabilities
|
|
94
|
+
|
|
95
|
+
### 1. Ultra-Low Latency Prompt & Security Radar (<5ms)
|
|
96
|
+
Deterministic pattern and AST scanning neutralizing prompt injections, system tag breakouts (`</system_instruction>`), and API token / private key leakages before downstream agent propagation.
|
|
97
|
+
|
|
98
|
+
### 2. Python Code AST Hazard Auditing
|
|
99
|
+
In-memory Python Abstract Syntax Tree (AST) inspection isolating hazardous invocations:
|
|
100
|
+
- System execution (`os.system`, `os.popen`, `subprocess.Popen`, `subprocess.run`)
|
|
101
|
+
- Arbitrary code evaluation (`eval`, `exec`, `__import__`)
|
|
102
|
+
- Network socket reverse shells and unencrypted exfiltration vectors.
|
|
103
|
+
|
|
104
|
+
### 3. Factual Grounding & NLI Hallucination Verification
|
|
105
|
+
Compares LLM text claims against trusted source documents or ledger ground truths, outputting:
|
|
106
|
+
- Grounding ratio (0.0 to 1.0)
|
|
107
|
+
- Explicit list of fabricated numbers and ungrounded entities.
|
|
108
|
+
|
|
109
|
+
### 4. Cryptographic Proof-of-Safety & Smart Contracts
|
|
110
|
+
- **EIP-191 Signatures**: Off-chain attestation receipts for agent-to-agent validation.
|
|
111
|
+
- **EIP-712 Typed Data & Solidity Calldata**: Native integration with [`SecurityGateConsumer.sol`](contracts/SecurityGateConsumer.sol) on Polygon (137), Base (8453), and Arbitrum (42161).
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## ๐ฆ Quick Start & Installation
|
|
116
|
+
|
|
117
|
+
### Option 1. Run Instantly with `uvx` (No Installation Required)
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Run stdio MCP server directly for LLM clients
|
|
121
|
+
uvx agent-security-gate-x402
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Option 2. Install from PyPI
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
pip install agent-security-gate-x402
|
|
128
|
+
|
|
129
|
+
# Run MCP server (stdio mode)
|
|
130
|
+
agent-security-gate
|
|
131
|
+
|
|
132
|
+
# Or launch interactive terminal tester
|
|
133
|
+
python test_interactive.py
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Option 3. Local Development Server
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
git clone https://github.com/nohosa001-pixel/security-gate-x402.git
|
|
140
|
+
cd security-gate-x402
|
|
141
|
+
pip install -e .
|
|
142
|
+
uvicorn app.main:app --port 8000 --reload
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## ๐ Smart Contract Integration (`SecurityGateConsumer.sol`)
|
|
148
|
+
|
|
149
|
+
Autonomous on-chain agents can verify security attestations directly in Solidity:
|
|
150
|
+
|
|
151
|
+
```solidity
|
|
152
|
+
// SPDX-License-Identifier: MIT
|
|
153
|
+
pragma solidity ^0.8.20;
|
|
154
|
+
|
|
155
|
+
import "./contracts/SecurityGateConsumer.sol";
|
|
156
|
+
|
|
157
|
+
contract AutonomousAgentExecutor {
|
|
158
|
+
SecurityGateConsumer public immutable securityGate;
|
|
159
|
+
|
|
160
|
+
constructor(address _securityGateAddress) {
|
|
161
|
+
securityGate = SecurityGateConsumer(_securityGateAddress);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function executeGuardedAction(
|
|
165
|
+
bytes32 payloadHash,
|
|
166
|
+
uint8 riskScore,
|
|
167
|
+
string calldata verdict,
|
|
168
|
+
uint256 expiresAt,
|
|
169
|
+
uint8 v,
|
|
170
|
+
bytes32 r,
|
|
171
|
+
bytes32 s,
|
|
172
|
+
address target,
|
|
173
|
+
bytes calldata callData
|
|
174
|
+
) external {
|
|
175
|
+
// Enforces max 10% risk score threshold and valid oracle signature
|
|
176
|
+
securityGate.verifyAndExecute(
|
|
177
|
+
payloadHash,
|
|
178
|
+
riskScore,
|
|
179
|
+
verdict,
|
|
180
|
+
expiresAt,
|
|
181
|
+
v,
|
|
182
|
+
r,
|
|
183
|
+
s,
|
|
184
|
+
target,
|
|
185
|
+
callData,
|
|
186
|
+
10 // maxRiskScore
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## ๐งช Testing
|
|
195
|
+
|
|
196
|
+
Run the full pytest suite:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
pytest -v tests/
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Launch the interactive terminal tester:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
python test_interactive.py
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## ๐ข X (Twitter) Automated Promotion & Security Alert Bot
|
|
211
|
+
|
|
212
|
+
Launch the automated promotion and status broadcast bot:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# Windows 1-Click launcher
|
|
216
|
+
.\x_promo_bot.bat
|
|
217
|
+
|
|
218
|
+
# Or run via Python directly
|
|
219
|
+
python x_promo_bot.py
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
- ๐ฐ๐ท **Korean Thread**: Comprehensive showcase of security radars, AST parser, and Web UI.
|
|
223
|
+
- ๐ **Global Launch Thread**: High-impact English launch announcement with 1-click test links.
|
|
224
|
+
- ๐ก๏ธ **Real-Time Security Bulletins**: Automated micro-oracle status and guardrail alerts.
|
|
225
|
+
- ๐ค **Dual Mode**: Direct X API v2 thread chaining (`requests_oauthlib`) or instant 1-click Web Intent browser launcher.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## ๐ License
|
|
230
|
+
|
|
231
|
+
MIT License © 2026 Security Gate Team
|
|
232
|
+
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Agent Output Security & Hallucination Gate (`agent-security-gate-x402`) ๐ก๏ธโก
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/agent-security-gate-x402/)
|
|
4
|
+
[](https://glama.ai/mcp/servers/nohosa001-pixel/agent-security-gate-x402)
|
|
5
|
+
[](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/)
|
|
6
|
+
[](https://polygon.technology)
|
|
7
|
+
[](https://fastapi.tiangolo.com)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
|
|
10
|
+
> **Ultra-low latency (<10ms) deterministic security, prompt injection, secret key leak, dangerous AST code, and factual hallucination inspection micro-oracle with EIP-191 & EIP-712 cryptographic attestations on Polygon, Base, and Arbitrum.**
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## ๐ฅ๏ธ Interactive Web Dashboard & Simulator (Live)
|
|
15
|
+
|
|
16
|
+
๐ **[https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/)**
|
|
17
|
+
|
|
18
|
+
Explore the full consumer and enterprise visual interface directly in your browser:
|
|
19
|
+
- ๐ก๏ธ **Prompt Injection & Jailbreak Radar**: Live testing against DAN prompts, system tag escapes, and adversarial suffixes.
|
|
20
|
+
- โก **Dangerous AST Code Analyzer**: Sub-millisecond Python syntax parsing detecting `os.system`, `subprocess`, `eval`, `exec`, and malicious sockets.
|
|
21
|
+
- ๐ **Hallucination & NLI Fact-Checker**: Contrast agent generation with ground truth context to surface fabricated numbers and unanchored claims.
|
|
22
|
+
- ๐ **EIP-712 On-Chain Attestation & Calldata**: Instant generation of `v, r, s` ABI calldata for EVM smart contracts.
|
|
23
|
+
- ๐ก **Real-Time Security Event Stream**: Live WebSocket event feed of inspection audits.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## ๐ Live Service Links & Resources
|
|
28
|
+
|
|
29
|
+
| Service / Endpoint | Description | URL Link |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| ๐ฅ๏ธ **Web Dashboard** | Interactive visual UI, security simulator & audit tester | [Launch Dashboard](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/dashboard) |
|
|
32
|
+
| โก **API Playground** | Browser-based interactive query sandbox | [Open Playground](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/playground) |
|
|
33
|
+
| ๐ก๏ธ **Live Inspection** | Core deterministic security & NLI hallucination check | [`/inspect`](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/inspect) |
|
|
34
|
+
| ๐ **On-Chain Calldata** | EIP-712 smart contract attestation calldata endpoint | [`/api/v1/gate/attestation/onchain`](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/api/v1/gate/attestation/onchain) |
|
|
35
|
+
| ๐ **Swagger API Docs** | Full interactive OpenAPI documentation | [View Swagger Docs](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/docs) |
|
|
36
|
+
| ๐ค **LLM Agent Manifest** | Machine-readable tool specifications | [`/llms.txt`](https://agent-security-gate-x402-7qxtp3324q-du.a.run.app/llms.txt) |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## โก 1-Click MCP Integration (Claude Desktop & Cursor)
|
|
41
|
+
|
|
42
|
+
Connect to Claude Desktop, Cursor, Gemini, or any Model Context Protocol client instantly:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"mcpServers": {
|
|
47
|
+
"security-gate-x402": {
|
|
48
|
+
"command": "uvx",
|
|
49
|
+
"args": ["agent-security-gate-x402"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## ๐ Core Services & Capabilities
|
|
58
|
+
|
|
59
|
+
### 1. Ultra-Low Latency Prompt & Security Radar (<5ms)
|
|
60
|
+
Deterministic pattern and AST scanning neutralizing prompt injections, system tag breakouts (`</system_instruction>`), and API token / private key leakages before downstream agent propagation.
|
|
61
|
+
|
|
62
|
+
### 2. Python Code AST Hazard Auditing
|
|
63
|
+
In-memory Python Abstract Syntax Tree (AST) inspection isolating hazardous invocations:
|
|
64
|
+
- System execution (`os.system`, `os.popen`, `subprocess.Popen`, `subprocess.run`)
|
|
65
|
+
- Arbitrary code evaluation (`eval`, `exec`, `__import__`)
|
|
66
|
+
- Network socket reverse shells and unencrypted exfiltration vectors.
|
|
67
|
+
|
|
68
|
+
### 3. Factual Grounding & NLI Hallucination Verification
|
|
69
|
+
Compares LLM text claims against trusted source documents or ledger ground truths, outputting:
|
|
70
|
+
- Grounding ratio (0.0 to 1.0)
|
|
71
|
+
- Explicit list of fabricated numbers and ungrounded entities.
|
|
72
|
+
|
|
73
|
+
### 4. Cryptographic Proof-of-Safety & Smart Contracts
|
|
74
|
+
- **EIP-191 Signatures**: Off-chain attestation receipts for agent-to-agent validation.
|
|
75
|
+
- **EIP-712 Typed Data & Solidity Calldata**: Native integration with [`SecurityGateConsumer.sol`](contracts/SecurityGateConsumer.sol) on Polygon (137), Base (8453), and Arbitrum (42161).
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## ๐ฆ Quick Start & Installation
|
|
80
|
+
|
|
81
|
+
### Option 1. Run Instantly with `uvx` (No Installation Required)
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Run stdio MCP server directly for LLM clients
|
|
85
|
+
uvx agent-security-gate-x402
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Option 2. Install from PyPI
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pip install agent-security-gate-x402
|
|
92
|
+
|
|
93
|
+
# Run MCP server (stdio mode)
|
|
94
|
+
agent-security-gate
|
|
95
|
+
|
|
96
|
+
# Or launch interactive terminal tester
|
|
97
|
+
python test_interactive.py
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Option 3. Local Development Server
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
git clone https://github.com/nohosa001-pixel/security-gate-x402.git
|
|
104
|
+
cd security-gate-x402
|
|
105
|
+
pip install -e .
|
|
106
|
+
uvicorn app.main:app --port 8000 --reload
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## ๐ Smart Contract Integration (`SecurityGateConsumer.sol`)
|
|
112
|
+
|
|
113
|
+
Autonomous on-chain agents can verify security attestations directly in Solidity:
|
|
114
|
+
|
|
115
|
+
```solidity
|
|
116
|
+
// SPDX-License-Identifier: MIT
|
|
117
|
+
pragma solidity ^0.8.20;
|
|
118
|
+
|
|
119
|
+
import "./contracts/SecurityGateConsumer.sol";
|
|
120
|
+
|
|
121
|
+
contract AutonomousAgentExecutor {
|
|
122
|
+
SecurityGateConsumer public immutable securityGate;
|
|
123
|
+
|
|
124
|
+
constructor(address _securityGateAddress) {
|
|
125
|
+
securityGate = SecurityGateConsumer(_securityGateAddress);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function executeGuardedAction(
|
|
129
|
+
bytes32 payloadHash,
|
|
130
|
+
uint8 riskScore,
|
|
131
|
+
string calldata verdict,
|
|
132
|
+
uint256 expiresAt,
|
|
133
|
+
uint8 v,
|
|
134
|
+
bytes32 r,
|
|
135
|
+
bytes32 s,
|
|
136
|
+
address target,
|
|
137
|
+
bytes calldata callData
|
|
138
|
+
) external {
|
|
139
|
+
// Enforces max 10% risk score threshold and valid oracle signature
|
|
140
|
+
securityGate.verifyAndExecute(
|
|
141
|
+
payloadHash,
|
|
142
|
+
riskScore,
|
|
143
|
+
verdict,
|
|
144
|
+
expiresAt,
|
|
145
|
+
v,
|
|
146
|
+
r,
|
|
147
|
+
s,
|
|
148
|
+
target,
|
|
149
|
+
callData,
|
|
150
|
+
10 // maxRiskScore
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## ๐งช Testing
|
|
159
|
+
|
|
160
|
+
Run the full pytest suite:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
pytest -v tests/
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Launch the interactive terminal tester:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
python test_interactive.py
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## ๐ข X (Twitter) Automated Promotion & Security Alert Bot
|
|
175
|
+
|
|
176
|
+
Launch the automated promotion and status broadcast bot:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Windows 1-Click launcher
|
|
180
|
+
.\x_promo_bot.bat
|
|
181
|
+
|
|
182
|
+
# Or run via Python directly
|
|
183
|
+
python x_promo_bot.py
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
- ๐ฐ๐ท **Korean Thread**: Comprehensive showcase of security radars, AST parser, and Web UI.
|
|
187
|
+
- ๐ **Global Launch Thread**: High-impact English launch announcement with 1-click test links.
|
|
188
|
+
- ๐ก๏ธ **Real-Time Security Bulletins**: Automated micro-oracle status and guardrail alerts.
|
|
189
|
+
- ๐ค **Dual Mode**: Direct X API v2 thread chaining (`requests_oauthlib`) or instant 1-click Web Intent browser launcher.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## ๐ License
|
|
194
|
+
|
|
195
|
+
MIT License © 2026 Security Gate Team
|
|
196
|
+
|