Skip to content

v0.6.0

Choose a tag to compare

@kenithphilip kenithphilip released this 21 Apr 20:22
· 17 commits to main since this release

v0.6.0 - Scanner protocol + coding-agent hook SDK redesign

Requires `tessera-mesh>=0.6.0`.

Supply chain scanner (Scanner protocol)

  • `_supply_chain_scanner` is now a `SupplyChainScanner` instance implementing the shared Scanner protocol
  • evaluate_tool_call reports structured findings with `rule_id` like `sc.typosquat`, `sc.curl_pipe_sh`, `sc.separator_shadow`
  • `/v1/supply-chain/check` response shape: `{allowed, primary_reason, max_severity, findings: [{rule_id, severity, message, arg_path, evidence, metadata}]}`
  • `supply_chain_block_severity` config removed (now a SupplyChainScanner constructor arg)

YARA scanner (new)

  • `_yara_scanner` is always instantiated with lazy import; `available=False` and no-op scan when yara-x is missing
  • Integrated in evaluate_tool_call after supply-chain check
  • Users can supply rules via direct instantiation; future config hook will expose `rules_dir`

Coding-agent hook SDK (full redesign)

Four adapters, one base class:

  • `agentmesh.sdk.claude_code.ClaudeCodeAdapter` - Claude Code hook format precisely implemented (session_id, hook_event_name, tool_name, tool_input; emits `{"decision":"block","reason":...}` AND exit 2)
  • `agentmesh.sdk.cursor.CursorAdapter`
  • `agentmesh.sdk.copilot.CopilotAdapter`
  • `agentmesh.sdk.gemini.GeminiAdapter`

Shared base `AgentHookAdapter` in `agentmesh.sdk.init` handles the stdin-JSON / stdout-JSON + exit-code pipeline. Two evaluator transports:

  • `HTTPEvaluator` (stdlib urllib, dependency-free) with `TESSERA_FAIL_OPEN` env var for explicit fail-closed (default) or fail-open
  • `InProcessEvaluator` wraps a callable for tests and all-in-one deployments

Install in Claude Code:

```json
// ~/.claude/settings.json
{
"hooks": {
"PreToolUse": [{
"matcher": "*",
"hooks": [{"type":"command","command":"python -m agentmesh.sdk.claude_code"}]
}]
}
}
```

Environment: `AGENTMESH_ENDPOINT=http://localhost:9090\` (required), `AGENTMESH_API_KEY=...` (optional), `TESSERA_FAIL_OPEN=0|1` (default 0).

Removed

  • `agentmesh.sdk.coding_agent` (replaced by per-agent modules)
  • Old module-level handlers in `claude_code` (replaced by ClaudeCodeAdapter)

Tests

179 passing (was 177). Full HTTP transport smoke tests for the evaluator (fail-open and fail-closed on unreachable endpoint).

Install

```bash
pip install -U agentmesh-mesh tessera-mesh
```