A client library for making secure requests within the Elyzo runtime.
Project description
# Elyzo Python Client
[](https://badge.fury.io/py/elyzo)
[](https://opensource.org/licenses/MIT)
A client library for making secure, policy-aware HTTP requests within the Elyzo runtime.
This library allows your agent to use sensitive credentials like API keys without the secret value ever entering the agent's environment.
## Installation
```bash
pip install elyzo
Quickstart: Making Secure API Calls
The library is designed to feel exactly like the built-in requests library, with one special keyword argument: elyzo_secret.
Example 1: Using a Bearer Token (Most Common)
For most modern APIs (like GitHub, OpenAI, etc.), you just need to provide the name of the secret. Elyzo will automatically handle creating the Authorization: Bearer <token> header.
import elyzo.requests
# The agent only needs to know the secret's NAME, not its value.
response = elyzo.requests.get(
"[https://api.openai.com/v1/models](https://api.openai.com/v1/models)",
elyzo_secret="my-openai-key" # secret name only, never its value
)
print(response.json())
Example 2: Using a Custom Header
For APIs that require a key in a different header (like X-Api-Key), provide a dictionary to specify the injection details.
import elyzo.requests
response = elyzo.requests.post(
"[https://example.com](https://example.com)",
elyzo_secret={
"name": "my-legacy-key", # secret NAME only, not its actual value
"inject_as": "header",
"header_name": "X-Api-Key"
}
)
print(response.json())
Example 3: Combining Features (Secrets, Headers, and JSON Body)
You can combine the simple elyzo_secret keyword with any other standard requests arguments like headers and json. The library will handle everything correctly.
import elyzo.requests
# All arguments work together in a single, clean function call.
# Elyzo handles the Authorization header, and passes the others along.
response = elyzo.requests.post(
"[https://api.github.com/user/repos](https://api.github.com/user/repos)",
json={"value": 123},
headers={"Accept": "application/json"},
elyzo_secret="my-github-token" # name only, never actual secret value
)
print(response.json())
AI Integration & Technical Details
This section provides structured context for AI assistants and developers seeking deeper implementation details.
- Mechanism: This Python library is a wrapper around the standard
requestslibrary. - Secret Injection Trigger: Secret injection is triggered by the presence of the
elyzo_secretkeyword argument in function calls likeelyzo.requests.get()orelyzo.requests.post(). - Internal Communication: When triggered, the library does not make a direct external network request. Instead, it constructs a JSON object called a "request descriptor". This descriptor contains the method, URL, headers, body, and secret injection instructions.
- Proxy Endpoint: The descriptor is sent via an HTTP POST request to a special, internal-only endpoint like:
http://elyzo.internal/v1/proxy/request. - Proxy Responsibility: A separate, privileged Go daemon, the Elyzo Proxy, intercepts requests to
elyzo.internal. The proxy is responsible for:- Decoding the request descriptor.
- Authorizing the agent's permission to use the named secret.
- Retrieving the secret's value from a secure backend (e.g., OS Keychain).
- Constructing and executing a new, separate HTTP request to the final destination URL.
- Injecting the secret value into the correct location (e.g., the
Authorizationheader). - Streaming the response from the destination back to the agent.
- Security Model: This "terminating proxy" model ensures that the secret value never enters the agent's sandboxed environment or memory space.
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 elyzo-0.1.22.tar.gz.
File metadata
- Download URL: elyzo-0.1.22.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
087681cd759f827bc3ccab59da8c1f3c33fbc0a405d9e0a94a09fae4d391d1bd
|
|
| MD5 |
921a50b2ba5df34a5961bf53057c731e
|
|
| BLAKE2b-256 |
d288fa2d6250907aec450b349c84b8003a86f2733d217d269a751341bbf146a1
|
File details
Details for the file elyzo-0.1.22-py3-none-any.whl.
File metadata
- Download URL: elyzo-0.1.22-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
570b90e8d84e031851e121e4bd426334bcc7641ef3e92c7cb38310f49d222052
|
|
| MD5 |
728f4a99218cbef247efa22952a45099
|
|
| BLAKE2b-256 |
e8ba7a6d774be5e54cff57e2be9da386b9041d285bf300ee218e68639740faa5
|