Skip to content

[feature] Agent Proxy: Just-In-Time Semantic Policy Injection #56

Description

@paudley

Pre-flight

  • I searched existing issues first.

Problem statement

Currently, loading all the SKILL.md and policy files into the system prompt incurs a heavy upfront token tax. The agent receives hundreds of rules for Python ASTs, Git workflows, and formatting, even if the current task only involves writing a simple Markdown file.

Proposed solution

Implement Semantic Policy Injection in the proxy. The system prompt should remain lean. The proxy should detect the agent's intent based on the tool calls it issues, and inject rules "Just-In-Time".

If a git commit tool is called -> Inject safe-git-workflow rules.

If a Python file is opened -> Inject Python AST policies.

Examples or prior art

OpenWolf utilizes a cerebrum.md approach to dynamically feed project-specific conventions to the agent only exactly when relevant.

Alternatives considered

Standard RAG systems querying a documentation vector database, but this risks injecting poorly aligned or hallucinated policy fragments compared to exact, rule-based trigger injection.

Additional context

This requires the proxy to have a robust pattern-matching or intent-detection mechanism on incoming AGENT_API tool requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions