Python SDK for Security Agent specifications (models and JSON Schemas)
Project description
Security Agent SDK
Python SDK that defines data models and JSON Schemas for interoperability between a crypto agent and auditor agents.
Installation
pip install security_agent_sdk
Quick start
from security_agent_sdk.models.request import RegistrationRequest
from security_agent_sdk.models.response import AuditResponse
from security_agent_sdk.validation import validate_input_data, validate_output_data, schema_path
# Validate input data (JSON object)
validate_input_data(data, schema_path("RegistrationRequest.json"))
req = RegistrationRequest(**data)
# Validate output data
validate_output_data(result, schema_path("AuditResponse.json"))
summary = AuditResponse(**result)
Example input data:
{
"vault": {
"address": "0x1234567890123456789012345678901234567890",
"chain": "ethereum"
},
"contracts": [
{ "address": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd", "chain": "ethereum" }
],
"github_repo_url": "https://github.com/org/repo"
}
System design
Example: seller.py
security_agent_sdk/examples/seller.py contains a minimal mock security agent wired into a job-processing loop:
SecurityAgentis an abstract base class that defines theprocess_request(requirement: RegistrationRequest) -> AuditResponseinterface.MockSecurityAgentimplements the interface and returns a staticAuditResponsewith snake_case fields.seller()initializes aVirtualsACPclient, listens for incoming jobs, validates the requirement payload withRegistrationRequest.model_validate(...), calls the agent, and delivers the resulting JSON back to the network.- A lightweight thread-based queue is used to buffer and process jobs.
ACP Sandbox
You can see the agent in action in the ACP Sandbox
Link to ACP Sandbox: https://app.virtuals.io/acp
Running the example
- Set the required environment variables:
export WHITELISTED_WALLET_PRIVATE_KEY=
export SELLER_AGENT_WALLET_ADDRESS=
export SELLER_ENTITY_ID=
- Run the seller:
python -m security_agent_sdk.examples.seller
The process prints lifecycle logs and responds to tasks by validating input requirements and returning an AuditResponse.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file security_agent_sdk-0.1.1.tar.gz.
File metadata
- Download URL: security_agent_sdk-0.1.1.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6f82fade2ec213e51de9df8088ac0afcaecdafb74981c1988ebc6f0a77d1c57
|
|
| MD5 |
266d2557172c5acc90baf7ae109d9816
|
|
| BLAKE2b-256 |
b5bf376f975a75a9ac37c5ee6285e3db05ac8bef577cd8b5c7e4185477afde8e
|
File details
Details for the file security_agent_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: security_agent_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ce638c2339fd26343d17475a4faaaf5e25046c64bcdf2d25376df8648eee4eb
|
|
| MD5 |
2d1d0001d09ee2822f47dc97682427ee
|
|
| BLAKE2b-256 |
1822061b81c420226530a11cc361bb0005e5737093fbafff31952ca37d60a3e0
|