Skip to main content

A lightweight framework to set allow policy for agents.

Project description


allow-agent

A lightweight framework to set allow policy for agents.


import allow-agent
pip install allow-agent

compatibility

Library Status Description
✅ browser-use Ready Direct browser usage via CDN/script
✅ langchain Ready LangChain framework compatibility
✅ openai Ready OpenAI API integration
✅ anthropic Ready Anthropic Claude support
✅ aisuite Ready Full AI framework compatibility
✅ requests Ready Python HTTP library integration

Examples

Request Filtering

import allow_agent

# Register a request filter function using the decorator
@allow_agent.request
def request_filter(url, method, headers, body):
    """
    Filter HTTP requests based on your own criteria
    Returns:
        - False to block the request
        - True to allow the request
    """
    # Block requests to specific domains
    if "domain.com" in url:
        return False
    
    # Allow all other requests
    return True

# Now all HTTP requests made using standard Python libraries
# (requests, urllib, httpx, aiohttp) will be filtered through your function

OpenAI

import allow_agent

# Basic usage with OpenAI
from openai import OpenAI
client = OpenAI(api_key="your-api-key")
response = client.chat.completions.create(
    model="gpt-o1",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "This is a test prompt."}
    ]
)
print(response.choices[0].message.content)

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

allow_agent-1.0.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

allow_agent-1.0.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file allow_agent-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for allow_agent-1.0.0.tar.gz
Algorithm Hash digest
SHA256 86698d38307b7027067d0aa35c022f1f188b24e5c3be36f88eef2dc01883ce8e
MD5 116052d940424b4857b2823891f3a66e
BLAKE2b-256 2f2a0f632338c4b5c5d8f11d29076e29f6e054c2969140fb1ee65190ef36f35c

See more details on using hashes here.

File details

Details for the file allow_agent-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: allow_agent-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for allow_agent-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 666d724226d62e9ffd4ab78e0bdde098eacdf9d955f0a355f7ce6704a1e0461b
MD5 de79a37405ee193a1ef02bfcfb0118f2
BLAKE2b-256 3ea7a48019c1ff0720692bbd98b3d62061e225d72a0956fb05ddea78f197a9a6

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