coalex
Python SDK for Coalex — AI governance observability for enterprises in regulated markets.
Built on OpenTelemetry.
Install
pip install coalex
# or
uv add coalex
Quick start
import coalex
coalex.register(api_key=os.environ["COALEX_API_KEY"], service_name="my-agent")
coalex.auto_instrument()
# `version` is the build this agent is running. It is optional today and omitting it warns
# (COA-2636): a trace with no version cannot be attributed to a build, and the dashboard
# records it as `unknown`. It becomes required in coalex 2.0.
with coalex.coalex_context(agent_id="support-agent", version="1.4.0"):
answer = my_agent.run(question)
decision = coalex.evaluate(
request_id=request_id,
input={"question": question},
output={"answer": answer},
# The metric catalogue is validated before the call: f1, word_overlap, bleu, rouge_l,
# exact_match, levenshtein, contains. This line used to read ["faithfulness"], which is not
# one of them — so the first example a customer copied raised ValueError (COA-2377).
metrics={"answer": ["f1", "word_overlap"]},
)
Diagnostics
The SDK logs under the coalex logger and never configures logging for you — a library that
calls basicConfig takes over your application's log configuration, which is not its to take. It
attaches a NullHandler and leaves the rest to you.
To see what it is doing:
import logging
logging.basicConfig(level=logging.INFO) # your application's own setup
logging.getLogger("coalex").setLevel(logging.DEBUG)
| Logger | What you see |
|---|---|
coalex.context |
which agent id a span was attributed to, and where it came from |
coalex.auto_instrument |
which frameworks were instrumented, and which were found but could not be |
coalex.safe_exporter |
span export failures — the first few, then a heartbeat, so a key that breaks mid-run still surfaces |
coalex.inventory |
whether the agent's self-declaration was accepted, and the server's reason if not |
Without raising the level you still get warnings and errors — but only through Python's lastResort handler if your application configures none of its own, which prints with no timestamp, level or logger name and cannot be filtered.
No API key, proxy token or upstream credential reaches a log line or an exception message. Raising the level does not change that: it is a property of what is written, not of what is filtered.
Telemetry never breaks your agent
A failing Coalex endpoint drops spans; it does not raise into your code. evaluate() and
resolve() do raise, because a governance decision you asked for and did not get is not something
to swallow.
TypeScript
There is a TypeScript SDK, and it is smaller. See Python vs TypeScript before choosing.
Documentation
Metadata
Release files for coalex 1.39.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| coalex-1.39.4.tar.gz | 130.4 kB | Without provenance | Details for coalex-1.39.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coalex-1.39.4-py3-none-any.whl | Python 3 | none | any | Details for coalex-1.39.4-py3-none-any.whl |
Total release size: 205.5 kB
Release files / coalex-1.39.4.tar.gz
| Download URL | coalex-1.39.4.tar.gz |
|---|---|
| Size | 130.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
813209c64f3964396decd6f29d075bab98d8a39646ce6a8c0d3d9df0d6a87c96
|
|
BLAKE2b-256 checksum How to use checksums |
9d7e4bf207957a190b1ad421aca978bdc05f13bd700c7da65d2c3f9984a95751
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / coalex-1.39.4-py3-none-any.whl
| Download URL | coalex-1.39.4-py3-none-any.whl |
|---|---|
| Size | 75.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2084ab2b894c48fcfac8a24b822729c28e69e34de88e375985eebe0d8c4ad3ad
|
|
BLAKE2b-256 checksum How to use checksums |
77286ff078086e77c60378fb3e7eb9b094957c620b79f946e18348b9818194e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for coalex 1.39.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.