Self-Learning Behavioural Enforcement for AI Coding Assistants

Read full text
Authors: Pantaleone Ruocco
Cited by: 0

Abstract

AI coding assistants execute shell commands, edit files, and manage infrastructure with minimal oversight. Current guardrails rely on static instruction files that degrade under context pressure and offer no mechanism to verify whether an AI's actions align with user intent. We present Claude Rule Enforcer (CRE), a two-layer enforcement system that intercepts every tool call in real time, verifies intent alignment against conversation context, and automatically promotes repeated enforcement decisions into permanent rules. CRE operates as a hook in the AI assistant's tool pipeline, making it impossible for the AI to bypass. We describe the architecture, the self-learning pipeline, a threat model addressing adversarial evasion and rule tampering, and results from a 14-day case study demonstrating an 84% detection rate for intent misalignments.

Fields of Study & Subjects

Software Engineering Research Adversarial Robustness in Machine Learning Security and Verification in Computing

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
1 March 2026
Language
EN