Custom Protocol Integration

Integrate ACGP with any agent framework or custom protocol.


Overview

ACGP is framework-agnostic. You can wrap any agent system with governance.


Integration Steps

1. Identify Decision Points

Find where your agent: - Plans actions - Makes decisions - Executes operations

2. Create Cognitive Traces

Capture reasoning before execution:

def agent_action(request):
    # Agent planning
    reasoning = agent.think(request)
    action = agent.plan(reasoning)

    # Create trace
    trace = CognitiveTrace(
        reasoning=reasoning,
        action=action.name,
        parameters=action.params
    )

    # Evaluate with ACGP
    result = steward.evaluate(trace)

    # Handle intervention
    if result.intervention == "OK":
        return agent.execute(action)

3. Handle Interventions

Implement appropriate responses for each intervention type.


Example: Custom Agent Framework

class MyCustomAgent:
    def __init__(self):
        self.steward = GovernanceSteward(acl_tier="ACL-2")

    def process_request(self, request):
        # Your agent logic
        plan = self.create_plan(request)

        # Add ACGP governance
        trace = CognitiveTrace(
            reasoning=plan.reasoning,
            action=plan.action,
            parameters=plan.parameters
        )

        result = self.steward.evaluate(trace)

        if result.intervention in ["OK", "NUDGE"]:
            return self.execute(plan)
        elif result.intervention == "BLOCK":
            raise ActionBlockedError(result.message)

Best Practices

Minimal Changes

Design integration to minimize changes to existing agent code.

Graceful Degradation

Handle steward failures gracefully - don't break your agent.

Performance

Use async evaluation to avoid blocking agent operations.


Examples Implementation Guides