Skip to main content

python toolset to secure AI agents with secret provisioning, authentication, call monitoring and authorization

Project description

AI Security Toolset - A toolset repository for AI agents

Overview

This toolset is intended for AI agents builders, to simplify your work, and reduce the level of boilerplate code you need to write.

Features

Secured environment variables provisioning

This toolset can populate API keys and secrets as environment variables. The secrets are stored in your secret management of choice and are provisioned at runtime into your process memory.
The secrets can be populated and depopulated, for a specific context: Agent, Tool, HTTP call.

Currently supported secret providers:

  • AWS Secret Manager
  • CyberArk Conjur
  • Local .env file (for development purposes)

However, this functionality is extensible, by implementing a SecretsProvider interface.

Example

For full, runnable examples, please see the examples directory.

...

from secure_ai_toolset.secrets.aws_secrets_manager_provider import AWSSecretsProvider
from secure_ai_toolset.secrets.environment_manager import EnvironmentVariablesManager


# Populate the environment variables from AWS Secrets Manager
@EnvironmentVariablesManager.set_env_vars(AWSSecretsProvider())
async def main() -> None:
    runtime = SingleThreadedAgentRuntime()
    tools: List[Tool] = [
        FunctionTool(get_stock_price, description='Get the stock price.')
    ]
    
    await ToolAgent.register(runtime, 'tool_executor_agent',
                             lambda: ToolAgent('tool executor agent', tools))

    await ToolUseAgent.register(
        runtime,
        'tool_use_agent',
        lambda: ToolUseAgent(
            AzureOpenAIChatCompletionClient(
                model='gpt-4o',
                azure_endpoint=os.getenv('AZURE_OPENAI_ENDPOINT'),
                azure_deployment='gpt-4o',
                api_version='2024-02-01',
                api_key=os.getenv('AZURE_OPENAI_KEY')),
            [tool.schema for tool in tools], 'tool_executor_agent'),
    )

    ...

Getting Started

  1. Consume the toolset from pypi.
  2. Follow one of our examples to see how to use the toolset.

pip

pip3 install secure-ai-toolset

poetry

poetry add secure-ai-toolset

Note: Please ensure you are using Poetry version >=2.1.1.

Contribution

Please make sure to read the CONTRIBUTING.md file if you want to contribute to this project.

Contact

Feel free to contact us via github issues. If there are any feature requests or issues in the project you may contact me through linkedin: Gil Adda

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

secure_ai_toolset-0.1.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

secure_ai_toolset-0.1.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file secure_ai_toolset-0.1.0.tar.gz.

File metadata

  • Download URL: secure_ai_toolset-0.1.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for secure_ai_toolset-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eeb4cb3c5824dbe6ec122a1f0f8e7a200a0ff3bb7a58d7da5d65bde2f6230bff
MD5 9cc9c8f7f4156e4d90786124638f33c0
BLAKE2b-256 8812a5ede6ca3c54ea5981560b62a41a29456c260dea9c019c600f9d1bbe8b3c

See more details on using hashes here.

File details

Details for the file secure_ai_toolset-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for secure_ai_toolset-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 126efb64ff119d165b5707cdb1a7b40c8406fbd3532b8d8a183ed298ae5d8809
MD5 52dd4b5f4632c7dac87b7685b6a3ebc6
BLAKE2b-256 e7a23726868a57851275f42b843a6f6a9c99c70266e636f709b9ed35317a72dc

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