Skip to main content

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

SD Scheme

Example: seller.py

security_agent_sdk/examples/seller.py contains a minimal mock security agent wired into a job-processing loop:

  • SecurityAgent is an abstract base class that defines the process_request(requirement: RegistrationRequest) -> AuditResponse interface.
  • MockSecurityAgent implements the interface and returns a static AuditResponse with snake_case fields.
  • seller() initializes a VirtualsACP client, listens for incoming jobs, validates the requirement payload with RegistrationRequest.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

ACP Sandbox screenshot

Running the example

  1. Set the required environment variables:
export WHITELISTED_WALLET_PRIVATE_KEY=
export SELLER_AGENT_WALLET_ADDRESS=
export SELLER_ENTITY_ID=
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

security_agent_sdk-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

security_agent_sdk-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

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

Hashes for security_agent_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b6f82fade2ec213e51de9df8088ac0afcaecdafb74981c1988ebc6f0a77d1c57
MD5 266d2557172c5acc90baf7ae109d9816
BLAKE2b-256 b5bf376f975a75a9ac37c5ee6285e3db05ac8bef577cd8b5c7e4185477afde8e

See more details on using hashes here.

File details

Details for the file security_agent_sdk-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for security_agent_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ce638c2339fd26343d17475a4faaaf5e25046c64bcdf2d25376df8648eee4eb
MD5 2d1d0001d09ee2822f47dc97682427ee
BLAKE2b-256 1822061b81c420226530a11cc361bb0005e5737093fbafff31952ca37d60a3e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page