Repository navigation
docs: document runtime policy contract and 'mounted vs exposed' guidance #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,89 @@ | ||||||||||||||||||||||||||
| # @driftcore/agent-runner (placeholder) | ||||||||||||||||||||||||||
| # @driftcore/agent-runner (runtime policy contract draft) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| This directory intentionally provides a minimal placeholder package so CI jobs that still run `npm install --prefix packages/agent-runner` do not fail. | ||||||||||||||||||||||||||
| This package is still a lightweight placeholder, but it now documents a precise split of responsibilities between: | ||||||||||||||||||||||||||
|
Comment on lines
+1
to
+3
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| The runtime implementation of an agent runner is not currently present in this repository. | ||||||||||||||||||||||||||
| - **Skills** (declarative policy input), and | ||||||||||||||||||||||||||
| - **Agent runtime/client** (operative policy enforcement). | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Core principle | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - If it says what should happen, it belongs in a **skill**. | ||||||||||||||||||||||||||
| - If it makes it happen, it belongs in the **runtime**. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Skills can express intent (preferences, constraints, escalation rules). Only runtime can attach/detach MCP servers, filter tool/resource visibility, and keep irrelevant capabilities out of model context. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Mental model | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - **MCP server/pack**: building full of tools. | ||||||||||||||||||||||||||
| - **Skill**: playbook for a job. | ||||||||||||||||||||||||||
| - **Runtime**: facilities manager with the keys. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| The playbook can request access patterns; runtime enforces them. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Runtime design target: `mounted != exposed` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Treat these as separate states: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - **Mounted**: runtime can reach the MCP pack/server. | ||||||||||||||||||||||||||
| - **Exposed**: model can see and invoke pack tools/resources/prompts. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| A pack can be mounted but hidden from the model until a policy condition is satisfied. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Minimal contract between skill and runtime | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| A skill should declare policy. Runtime should evaluate and enforce it. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ```yaml | ||||||||||||||||||||||||||
| skill_id: drupal-audit | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| mcp_policy: | ||||||||||||||||||||||||||
| startup_packs: | ||||||||||||||||||||||||||
| - core.fs | ||||||||||||||||||||||||||
| - core.git | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| allowed_packs: | ||||||||||||||||||||||||||
| - core.fs | ||||||||||||||||||||||||||
| - core.git | ||||||||||||||||||||||||||
| - docs.php | ||||||||||||||||||||||||||
| - web.search | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| default_visibility: hidden | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
Comment on lines
+39
to
+51
|
||||||||||||||||||||||||||
| escalation: | ||||||||||||||||||||||||||
| - when: evidence_gap | ||||||||||||||||||||||||||
| expose: | ||||||||||||||||||||||||||
| - docs.php | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - when: docs_exhausted | ||||||||||||||||||||||||||
| expose: | ||||||||||||||||||||||||||
| - web.search | ||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Runtime responsibilities (minimum viable) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| 1. **Pack registry** | ||||||||||||||||||||||||||
| - Know available pack IDs and how to start/stop each MCP server. | ||||||||||||||||||||||||||
| 2. **Policy evaluator** | ||||||||||||||||||||||||||
| - Read `mcp_policy` from selected skill and compute desired mounted/exposed sets. | ||||||||||||||||||||||||||
| 3. **Visibility model** | ||||||||||||||||||||||||||
| - Enforce `default_visibility`, and expose only allowed packs. | ||||||||||||||||||||||||||
| 4. **Escalation engine** | ||||||||||||||||||||||||||
| - Detect conditions (`evidence_gap`, `docs_exhausted`) and apply policy transitions. | ||||||||||||||||||||||||||
| 5. **Tool registry filter** | ||||||||||||||||||||||||||
| - Rebuild the model-visible tool/resource/prompt catalog whenever exposure changes. | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ## Suggested first proof of concept | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Implement a tiny runtime loop with three packs: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - `core` | ||||||||||||||||||||||||||
| - `local-dev` | ||||||||||||||||||||||||||
| - `web-research` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Policy behavior: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| 1. Start with `core` only exposed. | ||||||||||||||||||||||||||
| 2. On `evidence_gap`, expose `local-dev`. | ||||||||||||||||||||||||||
| 3. On `docs_exhausted`, expose `web-research`. | ||||||||||||||||||||||||||
|
Comment on lines
+83
to
+87
|
||||||||||||||||||||||||||
| Policy behavior: | |
| 1. Start with `core` only exposed. | |
| 2. On `evidence_gap`, expose `local-dev`. | |
| 3. On `docs_exhausted`, expose `web-research`. | |
| Note: these are simplified POC labels. In the YAML example above, `core` stands in for the always-available local packs (`core.fs` and `core.git`), `local-dev` stands in for the documentation/dev-assist pack (`docs.php`), and `web-research` maps to `web.search`. | |
| Policy behavior: | |
| 1. Start with `core` only exposed (`core.fs`/`core.git` in the YAML example). | |
| 2. On `evidence_gap`, expose `local-dev` (`docs.php` in the YAML example). | |
| 3. On `docs_exhausted`, expose `web-research` (`web.search` in the YAML example). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new section describes a runtime/skill policy seam and enforcement responsibilities, but this file otherwise documents current server implementation details. To avoid contradicting the “reflects current implementation” positioning of these AI docs, consider adding an explicit note here that the policy contract is a draft design target and not implemented/enforced by the current checked-in runtime.