Skip to content

Commit 9b70c67

Browse files
author
Execlave Release Bot
committed
Release execlave-sdk v1.4.0
Squashed export from the Execlave monorepo — see CHANGELOG.md for details.
0 parents  commit 9b70c67

51 files changed

Lines changed: 9509 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Execlave Python SDK — environment variables
2+
#
3+
# Read by execlave-sdk client when arguments are not passed explicitly.
4+
5+
# Your Execlave API key. Live keys are prefixed `exe_dev_`, `exe_stg_`, or `exe_prod_`.
6+
# Generate one in the dashboard: https://www.execlave.com/dashboard/api-keys
7+
EXECLAVE_API_KEY=
8+
9+
# Optional. Override the API base URL (defaults to https://api.execlave.com).
10+
# Set to http://localhost:4000 for local development against the dev backend.
11+
EXECLAVE_BASE_URL=
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "Bug report"
2+
description: "Report a reproducible defect in execlave-sdk"
3+
labels: ["bug", "triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to file a bug report. Security issues: please email security@execlave.com instead.
9+
- type: input
10+
id: sdk-version
11+
attributes:
12+
label: "execlave-sdk version"
13+
description: "Output of `pip show execlave-sdk | grep Version`"
14+
placeholder: "1.1.0"
15+
validations:
16+
required: true
17+
- type: input
18+
id: python-version
19+
attributes:
20+
label: "Python version"
21+
placeholder: "3.12.2"
22+
validations:
23+
required: true
24+
- type: dropdown
25+
id: integration
26+
attributes:
27+
label: "Integration in use (if any)"
28+
options:
29+
- "None (core SDK only)"
30+
- "LangChain (ExeclaveCallbackHandler)"
31+
- "OpenAI Agents SDK (ExeclaveTracingProcessor)"
32+
- "CrewAI (instrument_crew)"
33+
- "OpenTelemetry"
34+
- "Other"
35+
validations:
36+
required: true
37+
- type: textarea
38+
id: repro
39+
attributes:
40+
label: "Minimal reproduction"
41+
description: "The smallest code sample that reproduces the issue. Redact API keys."
42+
render: python
43+
validations:
44+
required: true
45+
- type: textarea
46+
id: expected
47+
attributes:
48+
label: "Expected behaviour"
49+
validations:
50+
required: true
51+
- type: textarea
52+
id: actual
53+
attributes:
54+
label: "Actual behaviour"
55+
description: "Include full traceback if any."
56+
validations:
57+
required: true
58+
- type: textarea
59+
id: context
60+
attributes:
61+
label: "Additional context"
62+
description: "OS, LLM provider, network constraints, etc."

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: "Security vulnerability"
4+
url: https://github.com/execlave-ai/execlave-python-sdk/security/advisories/new
5+
about: "Report a security issue privately. Do not open a public issue."
6+
- name: "Question / usage help"
7+
url: https://github.com/execlave-ai/execlave-python-sdk/discussions
8+
about: "Ask a question in GitHub Discussions."
9+
- name: "Dashboard / API / billing"
10+
url: https://www.execlave.com/support
11+
about: "For the hosted service (api.execlave.com, the dashboard, or billing)."
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Feature request"
2+
description: "Suggest a capability for execlave-sdk"
3+
labels: ["enhancement", "triage"]
4+
body:
5+
- type: textarea
6+
id: problem
7+
attributes:
8+
label: "What problem are you trying to solve?"
9+
description: "Describe the use case. Avoid prescribing a specific solution here."
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: proposal
14+
attributes:
15+
label: "Proposed API or behaviour"
16+
description: "Code snippets welcome. Be explicit about compatibility."
17+
render: python
18+
- type: textarea
19+
id: alternatives
20+
attributes:
21+
label: "Alternatives considered"
22+
- type: checkboxes
23+
id: willing-to-pr
24+
attributes:
25+
label: "Are you willing to open a PR?"
26+
options:
27+
- label: "Yes, I can implement this"
28+
- label: "Yes, with guidance from a maintainer"

CHANGELOG.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Changelog
2+
3+
All notable changes to `execlave-sdk` (Python) will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [1.4.0] - 2026-06-08
11+
12+
### Added
13+
14+
- **Optional HMAC request signing.** New `sign_requests` client argument (default
15+
`False`). When enabled, every request body is signed with HMAC-SHA256 keyed by
16+
the API key and sent with `X-Execlave-Timestamp` and `X-Execlave-Signature`
17+
(`sha256=<hex>`) headers. Implemented as a `requests` session auth callable, so
18+
it covers every call from a single point and signs the exact serialized body
19+
bytes (`${timestamp}.${body}`) the server verifies. Defense-in-depth on top of
20+
TLS + API-key auth; opt-in and fully backward-compatible (unsigned requests are
21+
unaffected when the server has not made signing mandatory).
22+
23+
## [1.3.0] - 2026-06-03
24+
25+
### Added
26+
27+
- **Agent identity stamping.** New `stamp_identity` client argument (default
28+
`False`). When enabled, the client issues and caches a short-lived RS256
29+
`exe_agt_` credential per agent and attaches it to each trace on ingest
30+
(`agentCredential` field), so the platform can cryptographically stamp who
31+
produced the trace. Best-effort and non-breaking: if a credential cannot be
32+
issued, traces are still sent unstamped — stamping never blocks or drops ingest.
33+
- **MCP tool-integrity surfaces.** Optional, backwards-compatible additions for
34+
MCP tool-supply-chain governance:
35+
- `tool_descriptor(server, tool, descriptor, description=None)` — computes the
36+
stable SHA-256 descriptor hash (canonical, key-order independent) used to pin
37+
and diff a tool.
38+
- `report_tool_baseline(agent_id, descriptors, reason="manual")` — pins the
39+
approved set of `(server, tool, descriptorHash)` tuples for an agent; re-pin
40+
with `reason="baseline_update"` after a reviewed tool update.
41+
- `enforce_policy()` accepts an optional `tool_descriptors` argument that is
42+
diffed against the agent's pinned baseline at runtime.
43+
- New `ToolIntegrityError` (subclass of `PolicyBlockedError`) is raised when an
44+
enforcement is denied by a `tool_integrity` policy. Callers that do not use
45+
these fields are unaffected.
46+
47+
### Changed
48+
49+
- No telemetry. The SDK does not phone home, emit anonymous usage events, or
50+
fetch remote configuration. Every network call goes to the Execlave backend
51+
URL configured by the caller.
52+
53+
## [1.2.1] - 2026-05-29
54+
55+
### Added
56+
57+
- **AI Agent Management Platform (AMP) surfaces.** Optional, backwards-compatible
58+
additions for the governance features:
59+
- `register_agent()` accepts an optional `autonomy_level`
60+
(`observe` | `advise` | `act_with_approval` | `autonomous`) that maps the
61+
agent onto a tiered-governance template.
62+
- New `report_agent_metadata()` method that records a version snapshot in the
63+
agent registry (`version_label` / `git_commit` / `deployed_at` / `notes` /
64+
`activate`) — call it from a deploy pipeline to build version history for
65+
diff/rollback.
66+
- Available on both `ExeclaveClient` and `AsyncExeclaveClient`. Callers that do
67+
not set these fields are unaffected.
68+
69+
## [1.2.0] - 2026-05-28
70+
71+
### Added
72+
73+
- **Framework auto-instrumentation modules** (opt-in via `execlave.integrations`,
74+
each with its own install extra): LangChain (`[langchain]`), OpenAI Agents SDK
75+
(`[openai-agents]`), CrewAI (`[crewai]`), LlamaIndex (`[llamaindex]`), Model
76+
Context Protocol (`[mcp]`), OpenAI Chat Completions (`[openai]`), and AutoGen
77+
(`[autogen]`). Each routes the framework's tool calls / completions through
78+
policy enforcement and trace ingestion without changing the host app's call
79+
sites.
80+
81+
## [1.1.5] - 2026-05-05
82+
83+
### Added
84+
85+
- `ValidatorDeniedError` (extends `PolicyBlockedError`) for programmatic handling
86+
of denials originating from a Custom Validator (BYOV). The `from_violations()`
87+
factory returns a `ValidatorDeniedError` when any violation is validator-sourced
88+
and a plain `PolicyBlockedError` otherwise, so existing `except` sites keep working.
89+
90+
### Fixed
91+
92+
- `http://api.execlave.com` is normalized to `https://api.execlave.com` so
93+
POST-based calls are not downgraded to GET by an HTTP-to-HTTPS redirect.
94+
- `enforce_policy()` now sends the client environment by default, matching
95+
`register_agent()` and avoiding accidental production-policy enforcement from
96+
development SDK clients.
97+
98+
## [1.1.4] - 2026-05-05
99+
100+
### Fixed
101+
102+
- `register_agent()` now handles agent responses wrapped as `{ "data": [...] }`
103+
by selecting the matching `agentId` instead of passing the list into `Agent`.
104+
Malformed list responses now raise `ExeclaveError` with a clear response-shape
105+
message instead of surfacing `AttributeError: 'list' object has no attribute 'get'`.
106+
107+
## [1.0.0] — 2026-04
108+
109+
### Added
110+
111+
- Initial public release of `execlave-sdk` on PyPI.
112+
- `ExeclaveClient` class with `enforce()`, `ingest_trace()`, and
113+
`register_agent()` methods.
114+
- Async variants via `AsyncExeclaveClient` (httpx-based).
115+
- Type hints throughout the public API, verified with `mypy --strict`.
116+
- PEP 621 `pyproject.toml` with a hatchling build backend.
117+
- Python 3.10+ supported; tested against 3.10, 3.11, and 3.12.
118+
- Support for API keys via the `exe_` / `exe_test_` prefix.
119+
120+
### Security
121+
122+
- TLS certificate verification is always enabled. Callers who need to
123+
target a self-signed local environment must set `verify=False` on the
124+
client explicitly and are warned on construction.
125+
- The SDK refuses to accept API keys that do not match the `exe_*` prefix,
126+
preventing accidental use of unrelated credentials.
127+
128+
[Unreleased]: https://github.com/rishitmavani/agentguard/compare/sdk-python-v1.3.0...HEAD
129+
[1.3.0]: https://github.com/rishitmavani/agentguard/compare/sdk-python-v1.2.1...sdk-python-v1.3.0
130+
[1.2.1]: https://github.com/rishitmavani/agentguard/compare/sdk-python-v1.2.0...sdk-python-v1.2.1
131+
[1.2.0]: https://github.com/rishitmavani/agentguard/compare/sdk-python-v1.1.5...sdk-python-v1.2.0
132+
[1.1.5]: https://github.com/rishitmavani/agentguard/compare/sdk-python-v1.1.4...sdk-python-v1.1.5
133+
[1.1.4]: https://github.com/rishitmavani/agentguard/compare/sdk-python-v1.1.3...sdk-python-v1.1.4
134+
[1.0.0]: https://github.com/rishitmavani/agentguard/releases/tag/sdk-python-v1.0.0

CODE_OF_CONDUCT.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We, as members, contributors, and maintainers of the `execlave-sdk` project, pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behaviour that contributes to a positive environment:
12+
13+
- Demonstrating empathy and kindness toward other people
14+
- Being respectful of differing opinions, viewpoints, and experiences
15+
- Giving and gracefully accepting constructive feedback
16+
- Accepting responsibility and apologising to those affected by our mistakes
17+
- Focusing on what is best for the overall community
18+
19+
Examples of unacceptable behaviour:
20+
21+
- The use of sexualised language or imagery, and sexual attention or advances of any kind
22+
- Trolling, insulting or derogatory comments, and personal or political attacks
23+
- Public or private harassment
24+
- Publishing others' private information without their explicit permission
25+
- Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behaviour and will take appropriate and fair corrective action in response to any behaviour that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies within all community spaces and also applies when an individual is officially representing the community in public spaces.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behaviour may be reported to the project team at **conduct@execlave.com**. All complaints will be reviewed and investigated promptly and fairly.
38+
39+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at <https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.
44+
45+
[homepage]: https://www.contributor-covenant.org

CONTRIBUTING.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Contributing to `execlave-sdk`
2+
3+
Thanks for wanting to contribute! This project is the official Python SDK for the Execlave AI Governance Platform.
4+
5+
## Ground rules
6+
7+
1. **By contributing, you agree your work will be released under the MIT licence** (see `LICENSE`).
8+
2. **Be kind.** See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
9+
3. **Security issues go to `security@execlave.com`**, never to a public issue. See [SECURITY.md](SECURITY.md).
10+
11+
## Development setup
12+
13+
```bash
14+
# Fork, then clone
15+
git clone https://github.com/<you>/execlave-python-sdk
16+
cd execlave-python-sdk
17+
18+
# Editable install with dev + test extras
19+
python -m venv .venv
20+
source .venv/bin/activate # or .venv\Scripts\activate on Windows
21+
pip install -e ".[test]"
22+
23+
# Run the full test suite
24+
pytest
25+
26+
# Run a single file
27+
pytest tests/test_client.py -v
28+
```
29+
30+
Python 3.11+ is required. The project uses `flit` for packaging and `pytest` for testing.
31+
32+
## Project layout
33+
34+
```
35+
execlave/
36+
├── client.py # Main Execlave client + enforce_policy
37+
├── trace.py # Trace class (chainable API)
38+
├── instrumentation/ # Span + event helpers (shared across integrations)
39+
├── integrations/
40+
│ ├── langchain.py # LangChain callback handler
41+
│ ├── openai_agents.py # OpenAI Agents SDK tracing processor
42+
│ └── crewai.py # CrewAI instrument_crew helper
43+
├── otel.py # OpenTelemetry bridge
44+
└── connectors.py # (Deprecated) run_langchain
45+
tests/ # pytest suite
46+
```
47+
48+
## Pull request checklist
49+
50+
- [ ] Tests pass (`pytest`)
51+
- [ ] Type hints added on any new public function signatures
52+
- [ ] Docstrings added or updated
53+
- [ ] `CHANGELOG.md` updated under *Unreleased* if the change is user-visible
54+
- [ ] No unrelated reformatting (keep diffs small)
55+
- [ ] For new integrations: pin the target framework's version range in `pyproject.toml` optional-deps
56+
57+
## Adding a new framework integration
58+
59+
1. Add a new module under `execlave/integrations/`.
60+
2. Import the framework at runtime only (inside `__init__` or a helper). The top-level `execlave` import must never require the framework.
61+
3. Use `execlave.instrumentation` helpers (`record_llm_call`, `record_tool_call`, `record_agent_action`) rather than driving `Trace` directly. This keeps span semantics consistent.
62+
4. Call `Execlave.enforce_policy(...)` on every external action (tool call, outbound HTTP, database write).
63+
5. Add an optional-dependency group in `pyproject.toml` with a pinned range.
64+
6. Add unit tests that mock the framework — CI does not install the real framework.
65+
7. Add a docs page at `frontend/app/docs/integrations/<name>/page.tsx` in the monorepo PR.
66+
67+
## Style
68+
69+
- `black` formatting, `ruff` linting (configured in `pyproject.toml`).
70+
- Prefer composition over inheritance.
71+
- No `print()` in library code; use `logging`.
72+
- Never swallow exceptions without logging — fail-open is acceptable for telemetry paths only, and must be logged at `warning`.
73+
74+
## Release process
75+
76+
Releases are driven from the monorepo. Tag `sdk-python/vX.Y.Z` publishes to PyPI via the `sdk-publish.yml` workflow. Versioning follows SemVer.
77+
78+
## Questions?
79+
80+
Open a discussion at <https://github.com/execlave-ai/execlave-python-sdk/discussions> or email `support@execlave.com`.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Rishit Mavani
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)