Publications

Forge implements 21 methods across agent architecture, security, auditing, licensing, and UI—11 novel techniques and 10 novel integrations of existing protocols into the AI agent domain. Each is documented in a paper and implemented in production code.

11
Novel Methods
10
Novel Integrations
10
Method Papers
1
Systems Paper

The 21 Methods

Novel = new technique    Integration = existing technique, new application to autonomous AI agents

Security Pipeline — 9-layer defense
01
Novel
Semantic Anomaly Detection
Embedding-based outlier detection. Chunks files, computes vector centroid, flags chunks with low cosine similarity + instruction-like keywords.
crucible.py · Paper 01
02
Novel
Behavioral Tripwire
Dual-gated temporal monitor (30s time + 3-call count) detects multi-step exploit chains. HMAC-SHA512 provenance chain.
crucible.py · Paper 02
03
Integration
Canary Honeypot
UUID-tagged canary injected into context. Recursive deep-scan catches exfiltration attempts referencing the canary in any encoding.
crucible.py · Paper 04
04
Integration
Static Pattern Scanner
21 compiled regexes across 5 threat categories: prompt injection, data exfiltration, obfuscation, hidden content, secret leaks.
crucible.py
05
Integration
Command Guard
Shell command gating with LOLBin detection. Blocks dangerous commands before execution based on safety level (L0–L3).
safety.py
06
Integration
Path Sandbox
Filesystem access restricted to declared workspace roots. Prevents the agent from reading or writing outside project boundaries.
safety.py
07
Novel
Output Fencing
Random nonce boundary wraps LLM output. Prevents the model from injecting tool calls or system directives into its own response stream.
engine.py
08
Integration
Rate Limiter
Circuit breaker for runaway tool-call loops. Sliding-window rate limiting prevents the agent from exceeding N operations per minute.
engine.py
09
Integration
SSRF Protection
URL validation blocks requests to internal networks, localhost, cloud metadata endpoints, and link-local addresses.
web_tools.py
Agent Core — runtime intelligence
10
Novel
Quarantine Context Partition
Five-partition context window (core/working/reference/recall/quarantine). Suspicious content isolated—evicted first, visible with warnings.
context.py · Paper 05
11
Novel
Continuity Grading
Six-signal quality score (A–F) monitors session health after every context swap. Swap freshness formula with exponential recovery + cumulative degradation.
continuity.py · Paper 03
12
Novel
Cross-Turn Deduplication
Graduated similarity thresholds (0.92 within-turn, 0.98 cross-turn) with sampled comparison for large payloads. Prevents redundant tool calls.
dedup.py · Paper 06
13
Novel
Zero-Token Governance
Nine deterministic subsystems replace LLM-mediated equivalents at zero marginal inference cost. The architectural thesis behind Forge.
forge/ · Paper 08
14
Integration
Adaptive Model Intelligence
Self-healing model orchestration with 5-axis quality scoring and three-tier retry escalation: re-prompt, re-configure, swap model.
ami.py · quality.py
Auditing Platform — /break & /assure
15
Integration
Trident Protocol
Every scenario tested with 3 independent prompt vectors (main + 2 variants). Pass/fail by majority vote. Prevents single-phrasing bias in evaluation.
assurance.py
16
Integration
Signed Assurance Reports
Ed25519-signed, tamper-evident audit artifacts with hash chain. Self-contained cryptographic proof — verifiable offline without contacting Forge.
assurance_report.py
17
Integration
Behavioral Fingerprint
30-probe behavioral signature capturing model identity across language semantics, refactoring judgment, and security awareness. Detects drift between audit runs.
behavioral_fingerprint.py
Licensing — behavioral proof-of-stake
18
Novel
Behavioral Proof-of-Stake
Licensing gated by demonstrated behavior, not just a key file. Genome maturity formula, Ed25519 challenge-response, fleet consensus with outlier detection.
passport.py
Neural Cortex UI — visual interface
19
Novel
Depth-Modulated Brain Animation
Volumetric neural activity illusion from a flat 2D image. Brightness-derived depth map, Gaussian-attenuated waves, cubic Hermite interpolation. 60+ FPS on CPU.
ui/dashboard.py · Paper 07
20
Novel
DWM Border Animation
OS-native window border color animation via DwmSetWindowAttribute (attribute 34) from Python/ctypes. First documented use from Python.
ui/effects.py · Paper 09
21
Novel
Live-Reference Theme System
Singleton dict mutated in-place on theme switch. All modules see new values instantly. Widget-tree recoloring for live preview with cancel-and-revert.
ui/themes.py · Paper 10
Systems Paper
Covers the full architecture end-to-end. Start here for the full picture.
Forge Systems Paper — March 2026
Forge: A Local-First AI Coding Agent with Zero-Token Governance, Nine-Layer Defense-in-Depth Security, and Adaptive Self-Healing
Comprehensive architecture paper covering 21 methods (11 novel, 10 novel integrations) across five domains. The nine-layer security pipeline achieves <5% false positive and <10% false negative rates at <50ms per-file scan latency. The zero-token governance layer replaces nine subsystems that would otherwise require LLM calls with deterministic algorithms, eliminating their token cost entirely. Adaptive Model Intelligence implements five-axis quality scoring with three-tier retry escalation (re-prompt, re-configure, swap model). Behavioral Proof-of-Stake provides cryptographic licensing via demonstrated behavior rather than static key files. The paper includes performance benchmarks, ablation studies, nightly integration test architecture (13 scenarios, 8 invariants), and a full configuration reference (101 keys).
Methods covered: All 21 — static patterns, semantic anomaly, behavioral tripwire, canary honeypot, command guard, path sandbox, output fencing, rate limiter, SSRF protection, quarantine partition, continuity grading, cross-turn dedup, zero-token governance, adaptive model intelligence, behavioral proof-of-stake, brain animation, DWM border, live themes
AI agents prompt injection defense context management self-healing local inference behavioral licensing forge/ — full codebase
Security Pipeline
Forge’s nine-layer defense-in-depth pipeline. Four layers live in the Crucible content scanner; five more are distributed across the engine, safety module, and web tools. Papers 01, 02, 04, and 05 cover this domain.
Paper 01
Embedding-Based Semantic Anomaly Detection for Prompt Injection in AI Code Agents
Deep dive into the Crucible’s second detection layer. Source files are segmented into fixed-size chunks (15 lines each, minimum 30 characters), embedded into vector space via the local embedding model, and each chunk’s cosine similarity to the file’s centroid is computed. Chunks falling below a 0.5 similarity threshold are evaluated for instruction-like keywords (13 trigger words including “execute”, “override”, “ignore”). A dual condition—low similarity AND 2+ keywords—is required to flag. Files under 20 lines or producing fewer than 3 valid chunks are skipped entirely, preventing false positives on short config files. This layer catches novel injection payloads that are semantically dissimilar to surrounding code but invisible to regex-based scanners.
Method covered: #02 Semantic Anomaly Detection (~90 lines in Crucible._scan_semantic())
prompt injection embedding cosine similarity outlier detection crucible.py
Paper 02
Temporal Behavioral Tripwire: Detecting Multi-Step Exploit Chains in Autonomous AI Agents
Deep dive into the Crucible’s third detection layer. After every file read, a dual-gated monitoring window opens: a 30-second time gate and a 3-call count gate. The window remains open until both gates are exceeded (AND logic, not OR). While open, every subsequent tool call is evaluated against exfiltration signatures (curl, wget, nc, ncat, invoke-webrequest, /dev/tcp, etc.) and credential-modification patterns (.ssh/, authorized_keys, crontab, registry). The paper covers the provenance tracking system that chains every observation with HMAC-SHA512, creating a tamper-evident record of the exploit sequence even if the agent later attempts to cover its tracks. Behavioral bigram analysis via the separate fingerprinting module detects anomalous tool-call sequences that don’t match the model’s established behavioral profile.
Method covered: #03 Behavioral Tripwire (~70 lines in Crucible._check_behavioral())
exploit chains temporal correlation dual-gate monitor HMAC-SHA512 provenance crucible.py
Paper 04
Defense-in-Depth: A Multi-Layer Threat Detection Architecture for Autonomous Code Agents
Describes the Crucible content scanner’s four internal detection layers—static pattern scanning (21 compiled regexes across 5 categories: prompt injection, data exfiltration, obfuscation, hidden content, and secret leaks), embedding-based semantic anomaly detection, temporal behavioral tripwire monitoring, and honeypot canary injection with recursive deep-scan—and how they compose into a single zero-cost scanning pass. These four layers form the core of Forge’s nine-layer security pipeline, which adds command guard, path sandbox, output fencing, rate limiting, and SSRF protection at the engine level. All nine layers operate at zero marginal LLM token cost. The paper also covers the HMAC-SHA512 provenance chain that links every file read, tool call, and threat detection into a tamper-evident audit trail.
Methods covered: #01 Static Pattern Scanner, #02 Semantic Anomaly Detection, #03 Behavioral Tripwire, #04 Canary Honeypot. References #05–#09 (engine-level layers).
defense in depth 9-layer pipeline canary honeypot provenance chain crucible.py · safety.py · engine.py
Paper 05
Partition-Based Context Management with Quarantine Isolation for AI Agent Safety
Describes the five-partition context window that replaces the traditional flat context buffer. Entries are assigned to core (never evicted—system prompt, tool definitions), working (current task state), reference (background docs), recall (episodic memory), or quarantine (flagged content). Eviction follows strict partition ordering: quarantine first, then recall, reference, working. Core entries and pinned entries survive all eviction. The quarantine partition is the novel contribution—instead of binary accept/reject, suspicious content is isolated in a degraded-trust zone where the agent can see it (marked with warnings) but it’s evicted first under memory pressure. This prevents both false-positive blocking of legitimate content and silent acceptance of malicious payloads. Importance scoring (0.0–1.0 float) provides fine-grained eviction ordering within each partition.
Method covered: #10 Quarantine Context Partition (~510 lines in context.py)
context management quarantine isolation eviction priority degraded trust context.py
Agent Core
The coding assistant’s runtime intelligence: context quality monitoring, tool-call optimization, and the zero-token governance architecture that makes the entire safety layer free. Papers 03, 06, and 08 cover this domain.
Paper 03
Quantitative Continuity Metrics for Long-Running LLM Agent Sessions
LLM agents lose knowledge when context is swapped. This paper introduces a six-signal continuity grade (A–F) that quantifies how much the agent “still knows” after each swap. The six signals—task state retention, decision retention, working memory depth, tool consistency, swap freshness, and semantic coherence—are weighted (0.25/0.25/0.15/0.15/0.10/0.10 with embeddings; 0.40/0.25/0.20/0.15 without) and combined into a 0–100 score. The key innovation is the swap freshness formula: (1 − e−0.4t) × 1/(1 + 0.05s), which models exponential recovery over turns with permanent cumulative degradation per swap, floored at 0.2 to prevent total collapse. Grade C triggers mild recovery (re-inject key context); D/F triggers aggressive recovery (full state rebuild). 60-second cooldown and 5-attempt cap prevent recovery loops.
Method covered: #11 Continuity Grading (~490 lines in continuity.py)
continuity grading swap freshness 6-signal scoring automatic recovery continuity.py
Paper 06
Cross-Turn Tool Call Deduplication with Graduated Similarity Thresholds
AI agents frequently re-execute identical or near-identical tool calls across conversation turns, wasting time and creating confusing duplicate output. This paper introduces graduated similarity thresholds: 0.92 within a single turn (aggressive dedup) and 0.98 across turns via a soft-reset mechanism that preserves one turn of history. Similarity is computed using edit-distance-based sequence matching (SequenceMatcher), not embeddings—keeping this in the zero-token governance layer. For arguments exceeding 5,000 characters, a sampled comparison algorithm evaluates prefix, middle, and suffix regions (weighted 0.35/0.30/0.35) in constant time rather than comparing the full strings. The soft reset on each new turn preserves cross-turn dedup while preventing stale history from blocking legitimate re-reads of changed files.
Method covered: #12 Cross-Turn Deduplication (~235 lines in dedup.py)
deduplication graduated thresholds sampled similarity soft reset dedup.py
Paper 08
Zero-LLM-Token Governance: Deterministic Safety and Monitoring for Local AI Coding Agents
The architectural thesis behind Forge: the entire safety, monitoring, and operational intelligence layer operates at zero marginal inference cost. Nine subsystems that would traditionally require LLM calls—context swap summaries, complexity-based model routing, token estimation, codebase semantic indexing, continuity grading, content threat detection, tool-call deduplication, forensic audit logging, and plan step verification—are implemented through deterministic algorithms, heuristics, and local embeddings instead. The paper quantifies the savings (session-dependent, varies with tool usage and swap frequency) by comparing Forge’s architecture against a hypothetical LLM-mediated equivalent. Every subsystem exposes a to_audit_dict() method for governance export, making the zero-cost layer fully auditable without requiring the auditor to understand the underlying LLM.
Method covered: #13 Zero-Token Governance (spans 9 modules across forge/)
zero-cost governance deterministic safety zero LLM cost local-first forge/ — 9 subsystems
Auditing Platform
The /break and /assure infrastructure: 161 adversarial scenarios, 30-probe behavioral fingerprinting, Ed25519-signed reports, and the Behavioral Proof-of-Stake licensing system. Covered in the systems paper.

The auditing platform does not have standalone method papers—its three novel methods (Behavioral Proof-of-Stake, Adaptive Model Intelligence, and 30-probe Behavioral Fingerprinting) are documented in the systems paper, sections 14–18 and Appendix A. These methods are tightly integrated: fingerprinting feeds the BPoS genome, AMI quality scores inform the assurance pass/fail criteria, and the signed report bundles all three into a tamper-evident artifact that can be uploaded to the Forge Matrix for public comparison.

Systems Paper — Sections 14–18
Behavioral Proof-of-Stake: Cryptographic Licensing via Demonstrated Behavior
Three license tiers (Community, Pro, Power) are gated not by a static key file but by a behavioral genome that matures over sessions. The genome maturity formula 1 / (1 + e−0.04(sessions − 50)) produces a logistic curve reaching 50% at session 50. A 30-probe behavioral fingerprint captures the model’s coding style across language semantics, refactoring judgment, and security awareness. Ed25519 challenge-response protocol validates the fingerprint against a fleet consensus server that detects outliers (cloned licenses, spoofed genomes). The signed passport is the same artifact used by /assure reports, creating a chain of trust from the model’s behavior to the published audit result.
Methods covered: #14 Adaptive Model Intelligence, #15 Behavioral Proof-of-Stake
BPoS Ed25519 behavioral fingerprint 30 probes fleet consensus passport.py · behavioral_fingerprint.py · proof_of_inference.py
Neural Cortex UI
Forge’s visual interface: the animated brain dashboard, OS-native window effects, and a theme system that drives 14 built-in themes with live hot-swap. Papers 07, 09, and 10 cover this domain.
Paper 07
Depth-Modulated Wave Propagation for Real-Time Neural Visualization in AI Agent Dashboards
The Neural Cortex dashboard’s signature feature: a flat 2D brain image that appears to pulse with volumetric depth. A brightness-derived depth map controls wave propagation delay (depth_delay = depth_map × 0.3) and attenuation (depth_atten = 1.0 − depth_map × 0.5), creating the illusion that waves travel into the brain rather than across it. Five render modes (radial, spiral, sweep, flash, pulse) are mapped to nine agent states (boot, idle, thinking, tool execution, indexing, swapping, error, threat, pass) with cubic Hermite smoothstep interpolation for state transitions. The entire rendering pipeline runs on CPU via NumPy array operations, maintaining 60+ FPS without GPU acceleration. Multiplicative glow blending (1.0 + wave × color × 2.0) preserves brain structure detail while adding dynamic color.
Method covered: #16 Depth-Modulated Brain Animation (~110 lines in AnimationEngine, ui/dashboard.py)
neural visualization depth modulation wave propagation 60+ FPS CPU ui/dashboard.py
Paper 09
OS-Native Window Border Animation via DWM API from Python/Tkinter
Windows 11 exposes DwmSetWindowAttribute with the undocumented DWMWA_BORDER_COLOR attribute (value 34), allowing programmatic control of the window frame color. This paper documents the first known use of this API from Python. The technique requires resolving the correct HWND via GetAncestor(hwnd, GA_ROOT) (Tkinter’s winfo_id() returns the wrong handle), converting RGB to BGR COLORREF format (b << 16 | g << 8 | r), and a startup probe to detect DWM availability before committing to border animation. The companion WindowEdgeGlow class adds Poisson-distributed spark particles along the window edges for theme-specific visual effects. Both classes degrade gracefully on systems where DWM is unavailable.
Method covered: #17 DWM Border Animation (~100 lines in WindowBorderColor, ~185 lines in WindowEdgeGlow)
DWM API DWMWA_BORDER_COLOR ctypes Windows 11 ui/effects.py
Paper 10
Live-Reference Theme System via In-Place Dict Mutation for Python GUI Applications
Traditional theme systems require either a full widget-tree rebuild or explicit notification callbacks when colors change. This paper presents an alternative: a singleton dict (_LIVE_COLORS) returned by reference from get_colors(). On theme switch, the dict is mutated in-place via .clear() + .update(), so every module holding a reference sees the new values instantly—no pub/sub, no observer pattern, no re-import. A complementary recolor_widget_tree() function walks the Tkinter widget hierarchy, mapping old colors to new via a snapshot taken before the mutation. This enables live preview with cancel-and-revert: snapshot the old dict, apply the new theme, and restore the snapshot if the user cancels. The system drives 14 built-in themes including three with animated visual effects (cyberpunk, matrix, plasma).
Method covered: #18 Live-Reference Theme System (~150 lines for the system, ~600 lines for 14 theme definitions)
theme system dict mutation live reference widget-tree recolor ui/themes.py

All methods are implemented in production code and verified against the reference implementation. The full source is available with a Forge license. The systems paper is available on request for academic review.