adapt-agent 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- adapt_agent-0.2.0/CHANGELOG.md +329 -0
- adapt_agent-0.2.0/CODE_OF_CONDUCT.md +132 -0
- adapt_agent-0.2.0/CONTRIBUTING.md +152 -0
- adapt_agent-0.2.0/LICENSE +21 -0
- adapt_agent-0.2.0/MANIFEST.in +33 -0
- adapt_agent-0.2.0/PKG-INFO +401 -0
- adapt_agent-0.2.0/README.md +341 -0
- adapt_agent-0.2.0/SECURITY.md +91 -0
- adapt_agent-0.2.0/adapt_agent/__init__.py +100 -0
- adapt_agent-0.2.0/adapt_agent/__main__.py +8 -0
- adapt_agent-0.2.0/adapt_agent/adapters/__init__.py +47 -0
- adapt_agent-0.2.0/adapt_agent/adapters/_governed.py +496 -0
- adapt_agent-0.2.0/adapt_agent/adapters/base.py +79 -0
- adapt_agent-0.2.0/adapt_agent/adapters/claude_agent/__init__.py +49 -0
- adapt_agent-0.2.0/adapt_agent/adapters/crewai/__init__.py +71 -0
- adapt_agent-0.2.0/adapt_agent/adapters/google_adk/__init__.py +50 -0
- adapt_agent-0.2.0/adapt_agent/adapters/langgraph/__init__.py +45 -0
- adapt_agent-0.2.0/adapt_agent/adapters/microsoft_agent_framework/__init__.py +47 -0
- adapt_agent-0.2.0/adapt_agent/adapters/openai_agents/__init__.py +65 -0
- adapt_agent-0.2.0/adapt_agent/adapters/pydantic_ai/__init__.py +45 -0
- adapt_agent-0.2.0/adapt_agent/adversarial/__init__.py +254 -0
- adapt_agent-0.2.0/adapt_agent/cli/__init__.py +885 -0
- adapt_agent-0.2.0/adapt_agent/cli/__main__.py +8 -0
- adapt_agent-0.2.0/adapt_agent/core/__init__.py +13 -0
- adapt_agent-0.2.0/adapt_agent/core/memory.py +223 -0
- adapt_agent-0.2.0/adapt_agent/core/middleware.py +288 -0
- adapt_agent-0.2.0/adapt_agent/core/policy.py +404 -0
- adapt_agent-0.2.0/adapt_agent/core/trust.py +200 -0
- adapt_agent-0.2.0/adapt_agent/core/types.py +82 -0
- adapt_agent-0.2.0/adapt_agent/evaluation/__init__.py +209 -0
- adapt_agent-0.2.0/adapt_agent/exceptions.py +52 -0
- adapt_agent-0.2.0/adapt_agent/observability/__init__.py +287 -0
- adapt_agent-0.2.0/adapt_agent/optimization/__init__.py +191 -0
- adapt_agent-0.2.0/adapt_agent/optimization/config.py +701 -0
- adapt_agent-0.2.0/adapt_agent/optimization/dataset.py +271 -0
- adapt_agent-0.2.0/adapt_agent/optimization/evals.py +257 -0
- adapt_agent-0.2.0/adapt_agent/optimization/evaluation.py +329 -0
- adapt_agent-0.2.0/adapt_agent/optimization/extractors.py +346 -0
- adapt_agent-0.2.0/adapt_agent/optimization/introspection/__init__.py +305 -0
- adapt_agent-0.2.0/adapt_agent/optimization/introspection/claude_agent.py +150 -0
- adapt_agent-0.2.0/adapt_agent/optimization/introspection/crewai.py +190 -0
- adapt_agent-0.2.0/adapt_agent/optimization/introspection/google_adk.py +218 -0
- adapt_agent-0.2.0/adapt_agent/optimization/introspection/langgraph.py +245 -0
- adapt_agent-0.2.0/adapt_agent/optimization/introspection/microsoft_agent_framework.py +177 -0
- adapt_agent-0.2.0/adapt_agent/optimization/introspection/openai_agents.py +219 -0
- adapt_agent-0.2.0/adapt_agent/optimization/introspection/pydantic_ai.py +238 -0
- adapt_agent-0.2.0/adapt_agent/optimization/judge.py +771 -0
- adapt_agent-0.2.0/adapt_agent/optimization/judges.py +254 -0
- adapt_agent-0.2.0/adapt_agent/optimization/metrics.py +424 -0
- adapt_agent-0.2.0/adapt_agent/optimization/optimizers.py +815 -0
- adapt_agent-0.2.0/adapt_agent/optimization/parameters.py +307 -0
- adapt_agent-0.2.0/adapt_agent/optimization/performance.py +201 -0
- adapt_agent-0.2.0/adapt_agent/optimization/proposers.py +464 -0
- adapt_agent-0.2.0/adapt_agent/optimization/providers.py +783 -0
- adapt_agent-0.2.0/adapt_agent/optimization/runners.py +244 -0
- adapt_agent-0.2.0/adapt_agent/optimization/target.py +318 -0
- adapt_agent-0.2.0/adapt_agent/patches/__init__.py +114 -0
- adapt_agent-0.2.0/adapt_agent/py.typed +0 -0
- adapt_agent-0.2.0/adapt_agent/security/__init__.py +11 -0
- adapt_agent-0.2.0/adapt_agent/security/firewall.py +366 -0
- adapt_agent-0.2.0/adapt_agent/security/taint_tracker.py +346 -0
- adapt_agent-0.2.0/adapt_agent/skills/__init__.py +460 -0
- adapt_agent-0.2.0/adapt_agent/skills/adapt-agent/SKILL.md +232 -0
- adapt_agent-0.2.0/adapt_agent/skills/adapt-agent/references/evals.md +248 -0
- adapt_agent-0.2.0/adapt_agent/skills/adapt-agent/references/guardrails.md +313 -0
- adapt_agent-0.2.0/adapt_agent/skills/adapt-agent/references/optimization.md +227 -0
- adapt_agent-0.2.0/adapt_agent.egg-info/PKG-INFO +401 -0
- adapt_agent-0.2.0/adapt_agent.egg-info/SOURCES.txt +190 -0
- adapt_agent-0.2.0/adapt_agent.egg-info/dependency_links.txt +1 -0
- adapt_agent-0.2.0/adapt_agent.egg-info/entry_points.txt +3 -0
- adapt_agent-0.2.0/adapt_agent.egg-info/requires.txt +38 -0
- adapt_agent-0.2.0/adapt_agent.egg-info/top_level.txt +1 -0
- adapt_agent-0.2.0/docs/adapters.md +302 -0
- adapt_agent-0.2.0/docs/api.md +300 -0
- adapt_agent-0.2.0/docs/cli.md +249 -0
- adapt_agent-0.2.0/docs/evals.md +285 -0
- adapt_agent-0.2.0/docs/frameworks/claude_agent.md +663 -0
- adapt_agent-0.2.0/docs/frameworks/crewai.md +637 -0
- adapt_agent-0.2.0/docs/frameworks/google_adk.md +611 -0
- adapt_agent-0.2.0/docs/frameworks/index.md +38 -0
- adapt_agent-0.2.0/docs/frameworks/langgraph.md +365 -0
- adapt_agent-0.2.0/docs/frameworks/microsoft_agent_framework.md +624 -0
- adapt_agent-0.2.0/docs/frameworks/openai_agents.md +590 -0
- adapt_agent-0.2.0/docs/frameworks/pydantic_ai.md +544 -0
- adapt_agent-0.2.0/docs/index.md +122 -0
- adapt_agent-0.2.0/docs/observability.md +179 -0
- adapt_agent-0.2.0/docs/optimization.md +195 -0
- adapt_agent-0.2.0/docs/policy.md +170 -0
- adapt_agent-0.2.0/docs/quickstart.md +183 -0
- adapt_agent-0.2.0/docs/releasing.md +155 -0
- adapt_agent-0.2.0/docs/security.md +255 -0
- adapt_agent-0.2.0/docs/skill.md +128 -0
- adapt_agent-0.2.0/examples/01_firewall_and_policy.py +104 -0
- adapt_agent-0.2.0/examples/02_adversarial_defense.py +47 -0
- adapt_agent-0.2.0/examples/03_langgraph_guarded_agent.py +105 -0
- adapt_agent-0.2.0/examples/04_observability.py +80 -0
- adapt_agent-0.2.0/examples/05_multi_framework_adapters.py +114 -0
- adapt_agent-0.2.0/examples/06_optimize_with_golden_dataset.py +118 -0
- adapt_agent-0.2.0/examples/07_train_from_yaml.py +97 -0
- adapt_agent-0.2.0/examples/08_agent_evals.py +221 -0
- adapt_agent-0.2.0/examples/README.md +129 -0
- adapt_agent-0.2.0/examples/claude_agent/01_basic_guarded.py +158 -0
- adapt_agent-0.2.0/examples/claude_agent/02_policy_observability_trust.py +216 -0
- adapt_agent-0.2.0/examples/claude_agent/03_evaluate_and_optimize.py +173 -0
- adapt_agent-0.2.0/examples/claude_agent/04_multi_agent_and_training.py +314 -0
- adapt_agent-0.2.0/examples/claude_agent/README.md +87 -0
- adapt_agent-0.2.0/examples/claude_agent/claude_agent.train.yaml +73 -0
- adapt_agent-0.2.0/examples/config.example.json +34 -0
- adapt_agent-0.2.0/examples/crewai/01_basic_guarded.py +135 -0
- adapt_agent-0.2.0/examples/crewai/02_policy_observability_trust.py +167 -0
- adapt_agent-0.2.0/examples/crewai/03_evaluate_and_optimize.py +180 -0
- adapt_agent-0.2.0/examples/crewai/04_multi_agent_and_training.py +368 -0
- adapt_agent-0.2.0/examples/crewai/README.md +44 -0
- adapt_agent-0.2.0/examples/crewai/crewai.train.yaml +73 -0
- adapt_agent-0.2.0/examples/google_adk/01_basic_guarded.py +161 -0
- adapt_agent-0.2.0/examples/google_adk/02_policy_observability_trust.py +205 -0
- adapt_agent-0.2.0/examples/google_adk/03_evaluate_and_optimize.py +154 -0
- adapt_agent-0.2.0/examples/google_adk/04_multi_agent_and_training.py +279 -0
- adapt_agent-0.2.0/examples/google_adk/README.md +103 -0
- adapt_agent-0.2.0/examples/google_adk/google_adk.train.yaml +69 -0
- adapt_agent-0.2.0/examples/langgraph/01_basic_guarded.py +102 -0
- adapt_agent-0.2.0/examples/langgraph/02_policy_observability_trust.py +127 -0
- adapt_agent-0.2.0/examples/langgraph/03_evaluate_and_optimize.py +148 -0
- adapt_agent-0.2.0/examples/langgraph/04_multi_agent_and_training.py +245 -0
- adapt_agent-0.2.0/examples/langgraph/README.md +36 -0
- adapt_agent-0.2.0/examples/langgraph/langgraph.train.yaml +65 -0
- adapt_agent-0.2.0/examples/microsoft_agent_framework/01_basic_guarded.py +151 -0
- adapt_agent-0.2.0/examples/microsoft_agent_framework/02_policy_observability_trust.py +194 -0
- adapt_agent-0.2.0/examples/microsoft_agent_framework/03_evaluate_and_optimize.py +177 -0
- adapt_agent-0.2.0/examples/microsoft_agent_framework/04_magentic_team_and_training.py +566 -0
- adapt_agent-0.2.0/examples/microsoft_agent_framework/README.md +62 -0
- adapt_agent-0.2.0/examples/microsoft_agent_framework/magentic.train.yaml +79 -0
- adapt_agent-0.2.0/examples/openai_agents/01_basic_guarded.py +111 -0
- adapt_agent-0.2.0/examples/openai_agents/02_policy_observability_trust.py +173 -0
- adapt_agent-0.2.0/examples/openai_agents/03_evaluate_and_optimize.py +149 -0
- adapt_agent-0.2.0/examples/openai_agents/04_multi_agent_and_training.py +282 -0
- adapt_agent-0.2.0/examples/openai_agents/README.md +67 -0
- adapt_agent-0.2.0/examples/openai_agents/openai_agents.train.yaml +69 -0
- adapt_agent-0.2.0/examples/pydantic_ai/01_basic_guarded.py +133 -0
- adapt_agent-0.2.0/examples/pydantic_ai/02_policy_observability_trust.py +180 -0
- adapt_agent-0.2.0/examples/pydantic_ai/03_evaluate_and_optimize.py +179 -0
- adapt_agent-0.2.0/examples/pydantic_ai/04_multi_agent_and_training.py +424 -0
- adapt_agent-0.2.0/examples/pydantic_ai/README.md +46 -0
- adapt_agent-0.2.0/examples/pydantic_ai/pydantic_ai.train.yaml +76 -0
- adapt_agent-0.2.0/examples/train.example.yaml +68 -0
- adapt_agent-0.2.0/pyproject.toml +225 -0
- adapt_agent-0.2.0/setup.cfg +4 -0
- adapt_agent-0.2.0/tests/__init__.py +1 -0
- adapt_agent-0.2.0/tests/test_action_refs.py +104 -0
- adapt_agent-0.2.0/tests/test_adapters.py +402 -0
- adapt_agent-0.2.0/tests/test_adversarial.py +30 -0
- adapt_agent-0.2.0/tests/test_adversarial_extra.py +254 -0
- adapt_agent-0.2.0/tests/test_cli.py +305 -0
- adapt_agent-0.2.0/tests/test_cli_optimize.py +361 -0
- adapt_agent-0.2.0/tests/test_cli_skills.py +183 -0
- adapt_agent-0.2.0/tests/test_core.py +97 -0
- adapt_agent-0.2.0/tests/test_evaluation.py +180 -0
- adapt_agent-0.2.0/tests/test_firewall_extra.py +254 -0
- adapt_agent-0.2.0/tests/test_governed_adapters.py +420 -0
- adapt_agent-0.2.0/tests/test_memory.py +163 -0
- adapt_agent-0.2.0/tests/test_middleware.py +306 -0
- adapt_agent-0.2.0/tests/test_observability.py +45 -0
- adapt_agent-0.2.0/tests/test_observability_extra.py +206 -0
- adapt_agent-0.2.0/tests/test_optimization.py +153 -0
- adapt_agent-0.2.0/tests/test_optimize_config.py +344 -0
- adapt_agent-0.2.0/tests/test_optimize_dataset.py +437 -0
- adapt_agent-0.2.0/tests/test_optimize_evals.py +405 -0
- adapt_agent-0.2.0/tests/test_optimize_evaluation.py +527 -0
- adapt_agent-0.2.0/tests/test_optimize_extractors.py +371 -0
- adapt_agent-0.2.0/tests/test_optimize_introspect_claude_agent.py +151 -0
- adapt_agent-0.2.0/tests/test_optimize_introspect_crewai.py +188 -0
- adapt_agent-0.2.0/tests/test_optimize_introspect_google_adk.py +191 -0
- adapt_agent-0.2.0/tests/test_optimize_introspect_langgraph.py +190 -0
- adapt_agent-0.2.0/tests/test_optimize_introspect_microsoft_agent_framework.py +147 -0
- adapt_agent-0.2.0/tests/test_optimize_introspect_openai_agents.py +185 -0
- adapt_agent-0.2.0/tests/test_optimize_introspect_pydantic_ai.py +140 -0
- adapt_agent-0.2.0/tests/test_optimize_introspection.py +393 -0
- adapt_agent-0.2.0/tests/test_optimize_judge.py +767 -0
- adapt_agent-0.2.0/tests/test_optimize_judges.py +506 -0
- adapt_agent-0.2.0/tests/test_optimize_metrics.py +522 -0
- adapt_agent-0.2.0/tests/test_optimize_optimizers.py +632 -0
- adapt_agent-0.2.0/tests/test_optimize_parameters.py +501 -0
- adapt_agent-0.2.0/tests/test_optimize_proposers.py +737 -0
- adapt_agent-0.2.0/tests/test_optimize_providers.py +788 -0
- adapt_agent-0.2.0/tests/test_optimize_runners.py +271 -0
- adapt_agent-0.2.0/tests/test_optimize_target.py +427 -0
- adapt_agent-0.2.0/tests/test_patches.py +116 -0
- adapt_agent-0.2.0/tests/test_policy.py +273 -0
- adapt_agent-0.2.0/tests/test_security.py +138 -0
- adapt_agent-0.2.0/tests/test_skills.py +834 -0
- adapt_agent-0.2.0/tests/test_taint_tracker.py +258 -0
- adapt_agent-0.2.0/tests/test_trust.py +162 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to ADAPT-Agent 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
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Bundled agent skill** (`adapt_agent/skills/adapt-agent/`): the wheel now
|
|
13
|
+
ships a `SKILL.md` plus reference files (`evals.md`, `guardrails.md`,
|
|
14
|
+
`optimization.md`) that teach a coding agent to use this library. Install it
|
|
15
|
+
with `adapt install skill` (`./.claude/skills/` by default, `--target user`
|
|
16
|
+
for `~/.claude/skills`, `--dir PATH` for anywhere else, `--force` to replace);
|
|
17
|
+
`adapt skills` lists what is bundled. Frontmatter stays within the portable
|
|
18
|
+
Agent Skills field set so the skill remains valid for a claude.ai upload or
|
|
19
|
+
the Skills API.
|
|
20
|
+
- **Skills registry API** (`adapt_agent.skills`): `available_skills()`,
|
|
21
|
+
`get_skill()`, `install_skill()` / `install_all()`, `default_destination()`,
|
|
22
|
+
`parse_frontmatter()` and `validate_skill()`, reading files through
|
|
23
|
+
`importlib.resources` so they work from a wheel, an editable checkout, or a
|
|
24
|
+
zipped distribution. Adds `SkillError` to the exception hierarchy. Importing
|
|
25
|
+
the registry pulls in no agent framework or LLM SDK. A skill's **directory
|
|
26
|
+
name is authoritative** — it locates the packaged files and names the
|
|
27
|
+
installed directory — while the frontmatter `name` is kept as
|
|
28
|
+
`Skill.declared_name` and a mismatch between the two is reported by
|
|
29
|
+
`validate_skill()`. Installing copies files through the traversable API and
|
|
30
|
+
stages them in a sibling directory before swapping into place, so it works
|
|
31
|
+
from a zip-imported package on every supported Python and a failed
|
|
32
|
+
`--force` upgrade leaves the existing installation intact. Destination and
|
|
33
|
+
staging setup failures are reported as `SkillError` rather than leaking a raw
|
|
34
|
+
`OSError`, matching the documented contract.
|
|
35
|
+
- **`adapt` console script**, a short alias for `adapt-agent` (both map to
|
|
36
|
+
`adapt_agent.cli:main`), so `uv run adapt install skill` works straight after
|
|
37
|
+
`uv add adapt-agent`. Help output echoes whichever name was invoked.
|
|
38
|
+
- **One-call framework evals** (`adapt_agent.optimization.evals`, re-exported
|
|
39
|
+
from `adapt_agent.evaluation`): `evaluate_agent(agent, data, metrics=...,
|
|
40
|
+
judge=...)` scores an agent built with any supported framework (LangGraph,
|
|
41
|
+
Microsoft Agent Framework, Google ADK, Pydantic AI, CrewAI, OpenAI Agents
|
|
42
|
+
SDK, Claude Agent SDK) or a plain callable against a golden dataset —
|
|
43
|
+
deterministic checks against specific outputs (text / number / regex / JSON),
|
|
44
|
+
per-row checks, and/or an LLM-as-judge — returning the standard
|
|
45
|
+
`EvaluationReport`. See `docs/evals.md` and `examples/08_agent_evals.py`.
|
|
46
|
+
- **Framework-native output extraction**
|
|
47
|
+
(`adapt_agent.optimization.extractors`): `extract_output_text()` unwraps run
|
|
48
|
+
results — Pydantic AI `AgentRunResult`, Microsoft `AgentRunResponse` /
|
|
49
|
+
`ChatMessage`, LangGraph final state, Google ADK / GenAI event streams and
|
|
50
|
+
`Content` parts, CrewAI `CrewOutput`, OpenAI Agents `RunResult`, Claude Agent
|
|
51
|
+
SDK `ResultMessage` / content blocks, conventional mappings/attributes, and
|
|
52
|
+
message/event streams — to final response text so text- and number-level
|
|
53
|
+
metrics compare answers rather than `repr()`s. Structural and
|
|
54
|
+
dependency-free (no framework imports); unrecognised values pass through
|
|
55
|
+
unchanged; extensible via `register_extractor()`. The `EvaluationHarness`
|
|
56
|
+
gains an `output_extractor=` option, and the CLI `evaluate` / `optimize`
|
|
57
|
+
commands gain `--extract-output`.
|
|
58
|
+
- **Framework runners** (`adapt_agent.optimization.runners`):
|
|
59
|
+
`framework_runner()` wraps any supported agent as a plain `input -> text`
|
|
60
|
+
callable (auto-adapting plain-string inputs for LangGraph message-state
|
|
61
|
+
graphs via `langgraph_inputs()`), and `adk_runner()` drives a Google ADK
|
|
62
|
+
agent or prebuilt `Runner` synchronously — sessions created per call so eval
|
|
63
|
+
examples stay independent, `google.adk` / `google.genai` imported lazily.
|
|
64
|
+
- **Per-row checks metric** (`adapt_agent.optimization.metrics.checks`): each
|
|
65
|
+
dataset row declares how it is scored via `metadata["check"]` — a built-in
|
|
66
|
+
name (`"numeric_close"`), a parameterised form (`{"name": "numeric_close",
|
|
67
|
+
"tolerance": 0.5}`), `"judge"` for LLM-judge rows, or a list combined with
|
|
68
|
+
`min`/`mean` — with undeclared rows falling back to a default (
|
|
69
|
+
`exact_match`). Registered as the `checks` built-in, so `--metric checks`
|
|
70
|
+
works from the CLI (judge-aware when `--judge` is also passed, and routing
|
|
71
|
+
judge calls only to rows that declare a judge check; `--metric judge` grades
|
|
72
|
+
every row explicitly).
|
|
73
|
+
- **Declarative YAML/JSON training config** (`adapt_agent.optimization.config`):
|
|
74
|
+
`load_training_config()` / `run_training()` and the `adapt-agent train CONFIG.yaml`
|
|
75
|
+
CLI command wire a whole optimization run (target, dataset, judge, metrics,
|
|
76
|
+
optimizer, explicit parameters) from one file. Temperature/`top_p` bounds that
|
|
77
|
+
exceed a provider's allowable range are clamped with a warning instead of
|
|
78
|
+
crashing; unknown metric/provider/optimizer/kind names raise a clear
|
|
79
|
+
`TrainingConfigError`. See `examples/07_train_from_yaml.py` and
|
|
80
|
+
`examples/train.example.yaml`.
|
|
81
|
+
- **Tool & skill optimization**: introspection now discovers `tools`/`skills` as
|
|
82
|
+
searchable knobs (drop-one ablation candidates), a new `ParameterKind.SKILL`,
|
|
83
|
+
and `ToolAblationProposer`. The LLM judge can act as an **adversary**
|
|
84
|
+
(`LLMJudge(adversarial=True)`) and propose *new* tools/skills from observed
|
|
85
|
+
failures (`LLMJudge.suggest_tools`, `LLMJudge.red_team`, `LLMToolProposer`);
|
|
86
|
+
`OptimizationResult.recommendations` surfaces those advisory suggestions.
|
|
87
|
+
- `OptimizableAgent.add_tool_parameter()` convenience for declaring tool/skill knobs.
|
|
88
|
+
|
|
89
|
+
### Packaging
|
|
90
|
+
|
|
91
|
+
- **Release automation to PyPI on tag, built and published with uv.** Pushing a
|
|
92
|
+
`v*` tag runs a gated pipeline: the tag must match `adapt_agent.__version__`;
|
|
93
|
+
the full lint / type-check / 3.10-3.14 test matrix is re-run on the tagged
|
|
94
|
+
commit (by reusing `ci.yml` as a callable workflow); `uv build --no-sources`
|
|
95
|
+
builds the distributions once, which are then checked with
|
|
96
|
+
`uvx twine check --strict`, asserted to contain the bundled skill, `py.typed`
|
|
97
|
+
and both console scripts, and smoke-tested by installing the wheel into a
|
|
98
|
+
clean `uv venv` and running `adapt install skill`; only then does
|
|
99
|
+
`uv publish` upload them via PyPI Trusted Publishing (OIDC, no stored API
|
|
100
|
+
token, PEP 740 attestations by default) and attach them to a generated
|
|
101
|
+
GitHub Release. `workflow_dispatch` runs the same pipeline against TestPyPI
|
|
102
|
+
for rehearsal, using the `testpypi` publish target declared under
|
|
103
|
+
`[[tool.uv.index]]`. See `docs/releasing.md`.
|
|
104
|
+
- Bundled skill files are declared as `package-data` and ship in **both** the
|
|
105
|
+
wheel and the sdist; a test asserts every skill file is covered by a
|
|
106
|
+
`package-data` glob, so a new file can't silently go missing from the wheel.
|
|
107
|
+
- Added `MANIFEST.in`, so the sdist also carries `docs/`, `examples/`,
|
|
108
|
+
`CHANGELOG.md` and the other project docs for downstream packagers.
|
|
109
|
+
- **Fixed the release workflow failing before it ran a single step.** It
|
|
110
|
+
referenced `astral-sh/setup-uv@v9`, which does not exist: that action
|
|
111
|
+
published floating major tags only up to `v7`, so `v8`/`v9`/`v10` resolve to
|
|
112
|
+
nothing and the run dies at *Prepare all required actions*. All three uses are
|
|
113
|
+
now pinned to the full tag `v10.0.1`.
|
|
114
|
+
- Added `scripts/check_action_refs.py`, run in CI's lint job, which resolves
|
|
115
|
+
every `uses:` ref in `.github/workflows/` against its remote and fails with
|
|
116
|
+
the newest published version when one is missing. `release.yml` only runs on
|
|
117
|
+
a tag, so without this check a bad ref is discovered after cutting one. An
|
|
118
|
+
unreachable remote is skipped rather than failed, so the gate cannot go
|
|
119
|
+
flaky.
|
|
120
|
+
- The distribution version is now single-sourced from `adapt_agent.__version__`
|
|
121
|
+
via `[tool.setuptools.dynamic]`, so the package and the distribution can no
|
|
122
|
+
longer disagree. Both artifacts pass `twine check`.
|
|
123
|
+
|
|
124
|
+
### Security
|
|
125
|
+
|
|
126
|
+
- The bundled skill's guardrail recipes previously demonstrated two controls
|
|
127
|
+
that **silently enforce nothing**, both now corrected and covered by tests:
|
|
128
|
+
a policy rule conditioned on `message[...]` never fires under a governed
|
|
129
|
+
adapter (adapters evaluate `check_state()`, so `message` is out of scope and
|
|
130
|
+
the default `fail_closed=False` treats it as no violation), and
|
|
131
|
+
`add_allowed_pattern()` on a default `Firewall` never rejects, because
|
|
132
|
+
allow-list enforcement requires `whitelist_mode=True`. The skill now screens
|
|
133
|
+
content with the firewall, gates state with policy rules, recommends
|
|
134
|
+
`PolicyEnforcer(fail_closed=True)` for security rules, and documents the
|
|
135
|
+
sandbox's real grammar (no function calls, no negative indexes).
|
|
136
|
+
- `Firewall`'s class docstring described `whitelist_mode=True` as "a strict
|
|
137
|
+
allowlist". It is not: allowed patterns **exempt** content and never reject
|
|
138
|
+
it, in either mode — content matching no allowed pattern is still allowed
|
|
139
|
+
once the block checks pass, and `whitelist_mode` changes only the precedence
|
|
140
|
+
between allowed and blocked patterns. The docstring now says so and points at
|
|
141
|
+
the working alternative (invert a custom filter). Behaviour is unchanged.
|
|
142
|
+
- The skill's example JSON config paired a `message`-scoped policy rule with
|
|
143
|
+
the `fail_closed=True` adapter recipe on the same page, which would have
|
|
144
|
+
refused every request; its rule now gates on state, with content screening
|
|
145
|
+
left to the `firewall` section. Its training-config example bound a
|
|
146
|
+
parameter to a component it never declared — the config parsed but
|
|
147
|
+
`adapt-agent train` would fail at build time.
|
|
148
|
+
|
|
149
|
+
### Documentation
|
|
150
|
+
|
|
151
|
+
- **Release guide** (`docs/releasing.md`): the one-time PyPI trusted-publisher
|
|
152
|
+
setup (including the *pending publisher* flow this first release needs), the
|
|
153
|
+
step-by-step release procedure, what the pipeline verifies before publishing,
|
|
154
|
+
and troubleshooting. Linked from the README, `CONTRIBUTING.md` and the nav.
|
|
155
|
+
- **Agent skill guide** (`docs/skill.md`): what a skill is, install targets,
|
|
156
|
+
the Python registry API, and the rules for bundling your own. Linked from the
|
|
157
|
+
MkDocs nav, the README, and `docs/cli.md` (which now documents both console
|
|
158
|
+
scripts and the `install` / `skills` commands).
|
|
159
|
+
- **Running Evals guide** (`docs/evals.md`): quick start, built-in check
|
|
160
|
+
table, per-row checks, LLM-as-judge, framework-by-framework notes (LangGraph
|
|
161
|
+
/ Microsoft Agent Framework / Google ADK / Pydantic AI / CrewAI / OpenAI
|
|
162
|
+
Agents / Claude Agent SDK), output extraction, direct-harness usage, and CLI
|
|
163
|
+
examples. Added `examples/08_agent_evals.py` (offline, no framework or API
|
|
164
|
+
key required) and new API reference entries.
|
|
165
|
+
- **Per-framework guides and example ladders** for all seven supported frameworks
|
|
166
|
+
(LangGraph, Microsoft Agent Framework, Google ADK, Pydantic AI, CrewAI, OpenAI
|
|
167
|
+
Agents SDK, Claude Agent SDK). Each framework gains a verbose
|
|
168
|
+
`docs/frameworks/<framework>.md` guide plus an `examples/<framework>/` folder
|
|
169
|
+
with a 3–4 step ladder (basic guarded agent → policy/observability/trust →
|
|
170
|
+
evaluate & optimize → multi-agent system + declarative YAML training), a
|
|
171
|
+
`train.yaml` template, and a README. Added a `docs/frameworks/` index hub, a new
|
|
172
|
+
"Framework Guides" section in the MkDocs nav, and a per-framework table in
|
|
173
|
+
`examples/README.md`. Examples guard their optional-framework import and run
|
|
174
|
+
offline (deterministic judge stubs, no API key) where they exercise ADAPT-Agent.
|
|
175
|
+
|
|
176
|
+
### Changed / Fixed
|
|
177
|
+
|
|
178
|
+
- **Judge robustness**: brace-depth JSON parsing, labeled-score extraction with
|
|
179
|
+
out-of-range rejection, `score_is_normalized`, position-swap debiasing in
|
|
180
|
+
`compare`, rubric moved to the provider `system` prompt with fenced untrusted
|
|
181
|
+
content (prompt-injection / reward-hacking hardening), and auth errors are
|
|
182
|
+
re-raised (not silently scored 0.0).
|
|
183
|
+
- **Provider sampling safety**: omit `temperature`/`top_p` for models that reject
|
|
184
|
+
them (e.g. Anthropic Opus 4.8/4.7, Fable 5), clamp to each provider's
|
|
185
|
+
`max_temperature`, and retry once without sampling params on a 400.
|
|
186
|
+
- **Security defaults**: firewall checks blocked patterns before any allow-list
|
|
187
|
+
short-circuit (allow no longer nullifies block; opt back in with
|
|
188
|
+
`whitelist_mode=True`); adversarial detection normalizes input (NFKC /
|
|
189
|
+
zero-width / whitespace) and records each attack once; `PolicyEnforcer(fail_closed=True)`
|
|
190
|
+
and a node-count cap; `TrustManager` LRU eviction with a distrust floor;
|
|
191
|
+
`TaintTracker` fails closed on evicted sources; `Middleware(fail_closed=True)`
|
|
192
|
+
and duplicate-name rejection.
|
|
193
|
+
- Introspection predicate hardening so a Microsoft Agent Framework `ChatAgent` /
|
|
194
|
+
magentic orchestrator is never mis-claimed by another framework's introspector.
|
|
195
|
+
- `min_improvement` default raised to `1e-3` (avoid chasing judge noise);
|
|
196
|
+
`EvaluationHarness(failure_threshold=...)`; dataset loaders gain explicit
|
|
197
|
+
`input_key`/`expected_key` overrides and no longer treat an `output` column as
|
|
198
|
+
ground truth.
|
|
199
|
+
- `pyyaml` is now a runtime dependency; the "dependency-free" framing is dropped
|
|
200
|
+
in favour of "install what the job needs" (agent-framework SDKs stay lazy).
|
|
201
|
+
- **Dataset-driven optimization & evaluation subsystem** (`adapt_agent.optimization`).
|
|
202
|
+
Evaluate any agent against a golden dataset and automatically optimize it --
|
|
203
|
+
tuning prompts, few-shot examples, models, hyperparameters, routing/topology,
|
|
204
|
+
and tool allow-lists -- for a single agent, six specialists, an
|
|
205
|
+
orchestrator + sub-agents, or a workflow, across every supported framework. All
|
|
206
|
+
import-safe and offline-testable (no LLM SDK or framework imported unless used).
|
|
207
|
+
New building blocks:
|
|
208
|
+
- `GoldenDataset` / `Example` -- load from list / JSON / JSONL / CSV, split,
|
|
209
|
+
sample.
|
|
210
|
+
- `Parameter` / `SearchSpace` -- tunable knobs bound to live framework objects.
|
|
211
|
+
- `OptimizableAgent` -- wrap arbitrary agent code as `run()` + a search space,
|
|
212
|
+
via `from_agent` / `from_components` / `from_callable`.
|
|
213
|
+
- `LLMJudge` -- provider-agnostic model-graded scoring **and** prompt
|
|
214
|
+
improvement, used at every stage (`score`/`compare`/`critique`/
|
|
215
|
+
`improve_prompt`/`as_metric`). Provider-specific subclasses `ClaudeJudge`,
|
|
216
|
+
`OpenAIJudge`, `AzureOpenAIJudge`, `GeminiJudge`, `MistralJudge`,
|
|
217
|
+
`CohereJudge`, `GroqJudge`, `TogetherJudge`, `OpenRouterJudge`, `OllamaJudge`,
|
|
218
|
+
`BedrockJudge`, `HuggingFaceJudge` (+ `get_judge`).
|
|
219
|
+
- `ModelProvider` and concrete providers (`anthropic`, `openai`,
|
|
220
|
+
`azure_openai`, `gemini`, `mistral`, `cohere`, `groq`, `together`,
|
|
221
|
+
`openrouter`, `ollama`, `bedrock`, `huggingface`, plus `callable` / `echo`),
|
|
222
|
+
each importing its SDK lazily; `get_provider` / `register_provider`.
|
|
223
|
+
- Metrics: `exact_match`, `contains`, `regex_match`, `token_f1`, `jaccard`,
|
|
224
|
+
`numeric_close`, `json_subset`, `levenshtein_ratio`, and `LLMJudge.as_metric`.
|
|
225
|
+
- `EvaluationHarness` / `EvaluationReport` -- run an agent over a dataset,
|
|
226
|
+
aggregate scores, surface failures.
|
|
227
|
+
- Proposers (`CandidateProposer`, `NumericProposer`, `PromptMutationProposer`,
|
|
228
|
+
`FewShotProposer`, `LLMProposer`) and optimizers (`CoordinateAscentOptimizer`,
|
|
229
|
+
`BootstrapFewShotOptimizer`, `GridSearchOptimizer`, `RandomSearchOptimizer`,
|
|
230
|
+
`EvolutionaryOptimizer`, `PipelineOptimizer`, `make_default_optimizer`).
|
|
231
|
+
- **Deep per-framework introspection** for all seven adapters (LangGraph,
|
|
232
|
+
Microsoft Agent Framework, Google ADK, Pydantic AI, CrewAI, OpenAI Agents,
|
|
233
|
+
Claude Agent SDK): turn a live agent object into bound, tunable parameters
|
|
234
|
+
(`adapt_agent.optimization.introspection`).
|
|
235
|
+
- The evaluation engine is re-exported from `adapt_agent.evaluation` so it is
|
|
236
|
+
discoverable in the "eval" namespace, and key symbols from the package root.
|
|
237
|
+
- **CLI commands** `adapt-agent evaluate` and `adapt-agent optimize` that load
|
|
238
|
+
an agent (``module:attribute``, with ``()`` to call a factory) and a golden
|
|
239
|
+
dataset (``.json``/``.jsonl``/``.csv``), score it with built-in metrics
|
|
240
|
+
and/or an LLM judge (``--judge claude|openai|gemini|...``), and optimize it
|
|
241
|
+
(``--optimizer``, ``--component NAME=module:attr`` for multi-agent systems,
|
|
242
|
+
``--save-config``, ``--val-data``, ``--json``).
|
|
243
|
+
- Docs (`docs/optimization.md`, expanded `docs/cli.md`) and a runnable, offline
|
|
244
|
+
example (`examples/06_optimize_with_golden_dataset.py`).
|
|
245
|
+
- **Shared `GovernedAdapter` base** (`adapt_agent.adapters._governed`) factoring
|
|
246
|
+
out the framework-agnostic governance pipeline (input screening, policy,
|
|
247
|
+
middleware, traced execution, output screening) with transparent handling of
|
|
248
|
+
sync results, async coroutines, and async event streams.
|
|
249
|
+
- **Six new framework adapters**, all built on `GovernedAdapter`:
|
|
250
|
+
`MicrosoftAgentFrameworkAdapter`, `GoogleADKAdapter`, `PydanticAIAdapter`,
|
|
251
|
+
`CrewAIAdapter` (now fully implemented), `OpenAIAgentsAdapter`, and
|
|
252
|
+
`ClaudeAgentSDKAdapter`. Each ships with its own optional extra
|
|
253
|
+
(e.g. `adapt-agent[pydantic-ai]`).
|
|
254
|
+
- Full `monitor` command output streaming for live observability sessions (planned).
|
|
255
|
+
|
|
256
|
+
### Changed
|
|
257
|
+
|
|
258
|
+
- `LangGraphAdapter` now subclasses `GovernedAdapter` (behaviour unchanged).
|
|
259
|
+
|
|
260
|
+
### Removed
|
|
261
|
+
|
|
262
|
+
- The placeholder `SemanticKernelAdapter` and the `semantic-kernel` extra have
|
|
263
|
+
been removed.
|
|
264
|
+
|
|
265
|
+
### Fixed
|
|
266
|
+
|
|
267
|
+
- `TaintTracker.get_stats` now counts each distinct source once per taint level
|
|
268
|
+
instead of once per (data, source) pairing, so a source tainting many data
|
|
269
|
+
items no longer inflates the `taint_level_distribution`.
|
|
270
|
+
- `AgentEvaluator.get_evaluation_results` now returns a shallow copy when called
|
|
271
|
+
without filters, preventing callers from mutating the evaluator's internal
|
|
272
|
+
results buffer.
|
|
273
|
+
|
|
274
|
+
## [0.2.0] - 2026-06-26
|
|
275
|
+
|
|
276
|
+
This release is a productisation pass that turns the 0.1.0 proof of concept into a
|
|
277
|
+
package that actually installs and is usable end to end.
|
|
278
|
+
|
|
279
|
+
### Fixed
|
|
280
|
+
|
|
281
|
+
- **Critical packaging bug.** The built wheel previously shipped only the top-level
|
|
282
|
+
`adapt_agent/__init__.py` and omitted every subpackage (`core`, `security`,
|
|
283
|
+
`adapters`, `optimization`, `adversarial`, `evaluation`, `observability`,
|
|
284
|
+
`patches`, `cli`). This broke `pip install adapt-agent` for all real usage —
|
|
285
|
+
importing anything beyond `__version__` raised `ImportError`. Packaging is now
|
|
286
|
+
configured to include the complete package tree.
|
|
287
|
+
|
|
288
|
+
### Added
|
|
289
|
+
|
|
290
|
+
- **PEP 561 typing marker.** Added a `py.typed` file so that downstream projects
|
|
291
|
+
pick up ADAPT-Agent's inline type hints under `mypy` and other type checkers.
|
|
292
|
+
- **Real LangGraph adapter.** `adapt_agent.adapters.langgraph` now provides a
|
|
293
|
+
working integration for wrapping LangGraph agents with ADAPT-Agent's trust,
|
|
294
|
+
policy, and security middleware. The Semantic Kernel
|
|
295
|
+
(`adapt_agent.adapters.semantic_kernel`) and CrewAI
|
|
296
|
+
(`adapt_agent.adapters.crewai`) adapters remain experimental/planned.
|
|
297
|
+
- **CLI `validate` command.** `adapt-agent validate <config_file>` validates an
|
|
298
|
+
agent configuration file (trust thresholds, policy rules, firewall settings).
|
|
299
|
+
- **CLI `monitor` command.** `adapt-agent monitor --agent-id <id>` starts an
|
|
300
|
+
observability session for a running agent.
|
|
301
|
+
- **Expanded public API.** Additional symbols are re-exported from the
|
|
302
|
+
`adapt_agent` top-level package, including core components (`TrustManager`,
|
|
303
|
+
`PolicyEnforcer`, `MemorySystem`, `Middleware`) and security components
|
|
304
|
+
(`Firewall`, `TaintTracker`).
|
|
305
|
+
- **CI/CD pipeline** running linting, type checking, and the test suite across
|
|
306
|
+
supported Python versions.
|
|
307
|
+
- **Test coverage** raised across the core, security, and adapter modules.
|
|
308
|
+
- **Documentation and examples** covering installation, the public API, the CLI,
|
|
309
|
+
and the LangGraph adapter.
|
|
310
|
+
|
|
311
|
+
### Changed
|
|
312
|
+
|
|
313
|
+
- Bumped version to `0.2.0`.
|
|
314
|
+
|
|
315
|
+
## [0.1.0] - 2024-01-01
|
|
316
|
+
|
|
317
|
+
### Added
|
|
318
|
+
|
|
319
|
+
- Initial public release.
|
|
320
|
+
- Core components: `TrustManager`, `PolicyEnforcer`, `MemorySystem`, and
|
|
321
|
+
`Middleware`.
|
|
322
|
+
- Security components: `Firewall` and `TaintTracker`.
|
|
323
|
+
- Initial scaffolding for framework adapters (LangGraph, Semantic Kernel, CrewAI),
|
|
324
|
+
optimization, adversarial defense, evaluation, observability, patches, and the
|
|
325
|
+
`adapt-agent` CLI (`info` command).
|
|
326
|
+
|
|
327
|
+
[Unreleased]: https://github.com/CodeHalwell/ADAPT-Agent/compare/v0.2.0...HEAD
|
|
328
|
+
[0.2.0]: https://github.com/CodeHalwell/ADAPT-Agent/compare/v0.1.0...v0.2.0
|
|
329
|
+
[0.1.0]: https://github.com/CodeHalwell/ADAPT-Agent/releases/tag/v0.1.0
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
+
identity and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
+
community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
31
|
+
any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email address,
|
|
35
|
+
without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official email address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
danielhalwell@gmail.com.
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series of
|
|
86
|
+
actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or permanent
|
|
93
|
+
ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
113
|
+
community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.1, available at
|
|
119
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by
|
|
122
|
+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
123
|
+
|
|
124
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
125
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
126
|
+
[https://www.contributor-covenant.org/translations][translations].
|
|
127
|
+
|
|
128
|
+
[homepage]: https://www.contributor-covenant.org
|
|
129
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
130
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
131
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
132
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Contributing to ADAPT-Agent
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing to **ADAPT-Agent** (Adversarial Defense &
|
|
4
|
+
Policy Training for LLM Agents). This guide covers how to set up a development
|
|
5
|
+
environment, the tooling we use, and the conventions we expect for branches,
|
|
6
|
+
commits, and pull requests.
|
|
7
|
+
|
|
8
|
+
By participating in this project you agree to abide by our
|
|
9
|
+
[Code of Conduct](CODE_OF_CONDUCT.md).
|
|
10
|
+
|
|
11
|
+
## Development environment
|
|
12
|
+
|
|
13
|
+
ADAPT-Agent targets supported, currently maintained Python versions. Clone the
|
|
14
|
+
repository and install it in editable mode with the development extras:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
git clone https://github.com/CodeHalwell/ADAPT-Agent.git
|
|
18
|
+
cd ADAPT-Agent
|
|
19
|
+
|
|
20
|
+
# Create and activate a virtual environment (recommended)
|
|
21
|
+
python -m venv .venv
|
|
22
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
23
|
+
|
|
24
|
+
# Install the package with development dependencies
|
|
25
|
+
pip install -e ".[dev]"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If you are working on a specific framework adapter, install its extra as well, for
|
|
29
|
+
example `pip install -e ".[dev,langgraph]"`.
|
|
30
|
+
|
|
31
|
+
### Pre-commit hooks
|
|
32
|
+
|
|
33
|
+
We use [pre-commit](https://pre-commit.com/) to run formatting and linting before
|
|
34
|
+
each commit. Install the hooks once after cloning:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pre-commit install
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The hooks run automatically on `git commit`. To run them against the whole
|
|
41
|
+
codebase manually:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pre-commit run --all-files
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Running tests
|
|
48
|
+
|
|
49
|
+
We use [pytest](https://docs.pytest.org/):
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pytest
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
To check coverage locally:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pytest --cov=adapt_agent --cov-report=term-missing
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Pull requests must keep total coverage at **85% or higher** and must pass CI.
|
|
62
|
+
|
|
63
|
+
## Linting, formatting, and type checking
|
|
64
|
+
|
|
65
|
+
Before opening a pull request, make sure the following all pass:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
ruff check . # Lint
|
|
69
|
+
black . # Format
|
|
70
|
+
mypy adapt_agent # Static type checking
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
ADAPT-Agent ships a PEP 561 `py.typed` marker, so the public API is expected to be
|
|
74
|
+
fully type-annotated. Please add type hints to any new code and keep `mypy` clean.
|
|
75
|
+
|
|
76
|
+
## What to work on
|
|
77
|
+
|
|
78
|
+
Contributions are welcome across the library, including:
|
|
79
|
+
|
|
80
|
+
- **Core** (`adapt_agent/core`) — trust management, policy enforcement, memory,
|
|
81
|
+
middleware.
|
|
82
|
+
- **Security** (`adapt_agent/security`) — firewall and taint tracking.
|
|
83
|
+
- **Adapters** (`adapt_agent/adapters`) — all adapters share the
|
|
84
|
+
`GovernedAdapter` base; adding support for a new framework is usually a thin
|
|
85
|
+
subclass. New framework integrations are a great place to help.
|
|
86
|
+
- **CLI** (`adapt_agent/cli`) — `info`, `validate`, and `monitor` commands.
|
|
87
|
+
- **Optimization, adversarial defense, evaluation, observability, and patches.**
|
|
88
|
+
|
|
89
|
+
For security-relevant changes, please also read [SECURITY.md](SECURITY.md). Do not
|
|
90
|
+
file vulnerability details in public issues.
|
|
91
|
+
|
|
92
|
+
## Branch and pull request conventions
|
|
93
|
+
|
|
94
|
+
1. **Branch off `main`.** Use a short, descriptive branch name with a prefix that
|
|
95
|
+
reflects the change type, for example:
|
|
96
|
+
- `feat/langgraph-streaming`
|
|
97
|
+
- `fix/wheel-packaging`
|
|
98
|
+
- `docs/cli-usage`
|
|
99
|
+
- `test/firewall-coverage`
|
|
100
|
+
- `chore/bump-deps`
|
|
101
|
+
2. **Keep PRs focused.** One logical change per pull request makes review faster.
|
|
102
|
+
3. **Update the changelog.** Add an entry under `## [Unreleased]` in
|
|
103
|
+
[CHANGELOG.md](CHANGELOG.md) describing user-visible changes.
|
|
104
|
+
4. **Fill in the PR template.** Complete the checklist and describe the type of
|
|
105
|
+
change.
|
|
106
|
+
5. **Link related issues** using `Fixes #123` / `Closes #123` where applicable.
|
|
107
|
+
|
|
108
|
+
A pull request is ready to merge when:
|
|
109
|
+
|
|
110
|
+
- [ ] Tests have been added or updated for the change.
|
|
111
|
+
- [ ] Coverage remains at 85% or higher.
|
|
112
|
+
- [ ] `ruff check .`, `black .`, and `mypy adapt_agent` all pass.
|
|
113
|
+
- [ ] Documentation has been updated where relevant.
|
|
114
|
+
- [ ] `CHANGELOG.md` has been updated.
|
|
115
|
+
- [ ] CI is green.
|
|
116
|
+
|
|
117
|
+
Maintainers: see [docs/releasing.md](docs/releasing.md) for how a version tag
|
|
118
|
+
publishes to PyPI.
|
|
119
|
+
|
|
120
|
+
## Commit messages
|
|
121
|
+
|
|
122
|
+
We recommend [Conventional Commits](https://www.conventionalcommits.org/):
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
<type>(<optional scope>): <short summary>
|
|
126
|
+
|
|
127
|
+
<optional body explaining what and why>
|
|
128
|
+
|
|
129
|
+
<optional footer, e.g. "Fixes #123">
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Common types: `feat`, `fix`, `docs`, `test`, `refactor`, `perf`, `chore`, `ci`.
|
|
133
|
+
|
|
134
|
+
Examples:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
fix(packaging): include all subpackages in the built wheel
|
|
138
|
+
feat(adapters): add LangGraph trust/policy middleware adapter
|
|
139
|
+
docs(cli): document validate and monitor commands
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Write messages in the imperative mood ("add", not "added") and keep the summary
|
|
143
|
+
line under ~72 characters.
|
|
144
|
+
|
|
145
|
+
## Reporting bugs and requesting features
|
|
146
|
+
|
|
147
|
+
Please use the issue templates:
|
|
148
|
+
|
|
149
|
+
- [Bug report](.github/ISSUE_TEMPLATE/bug_report.md)
|
|
150
|
+
- [Feature request](.github/ISSUE_TEMPLATE/feature_request.md)
|
|
151
|
+
|
|
152
|
+
Thanks again for contributing!
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 ADAPT-Agent Contributors
|
|
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,0 +1,33 @@
|
|
|
1
|
+
# Source-distribution contents beyond what setuptools includes automatically.
|
|
2
|
+
#
|
|
3
|
+
# The wheel's runtime data (py.typed, the bundled agent skills) is declared in
|
|
4
|
+
# pyproject.toml under [tool.setuptools.package-data]; this file governs the
|
|
5
|
+
# sdist, so a downstream packager building from source gets the docs, examples
|
|
6
|
+
# and tests too.
|
|
7
|
+
|
|
8
|
+
include LICENSE
|
|
9
|
+
include README.md
|
|
10
|
+
include CHANGELOG.md
|
|
11
|
+
include CONTRIBUTING.md
|
|
12
|
+
include CODE_OF_CONDUCT.md
|
|
13
|
+
include SECURITY.md
|
|
14
|
+
|
|
15
|
+
# Runtime package data. These also reach the sdist via
|
|
16
|
+
# [tool.setuptools.package-data], but naming them here keeps the sdist correct
|
|
17
|
+
# if that ever changes: without SKILL.md, `adapt install skill` has nothing to
|
|
18
|
+
# install, and without py.typed downstream type checkers ignore the package.
|
|
19
|
+
include adapt_agent/py.typed
|
|
20
|
+
recursive-include adapt_agent/skills *.md
|
|
21
|
+
recursive-include adapt_agent/skills/*/scripts *
|
|
22
|
+
|
|
23
|
+
recursive-include docs *.md
|
|
24
|
+
recursive-include examples *.py *.md *.yaml *.yml *.json *.jsonl
|
|
25
|
+
recursive-include tests *.py
|
|
26
|
+
|
|
27
|
+
exclude .pre-commit-config.yaml
|
|
28
|
+
prune .github
|
|
29
|
+
prune .jules
|
|
30
|
+
global-exclude __pycache__
|
|
31
|
+
global-exclude *.py[cod]
|
|
32
|
+
global-exclude *.so
|
|
33
|
+
global-exclude .DS_Store
|