open-agents-ai 0.186.6 → 0.186.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +61 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1072,6 +1072,67 @@ The identity kernel maintains a persistent self-model across sessions, the refle
1072
1072
  | L8 | Darwin Gödel Machine: Open-Ended Self-Improvement (2025) | [arxiv:2505.22954](https://arxiv.org/abs/2505.22954) |
1073
1073
  | L8 | i-MENTOR: Intrinsic Motivation Exploration (2025) | [arxiv:2505.17621](https://arxiv.org/abs/2505.17621) |
1074
1074
 
1075
+ ## Agent Immune System — Constraint Enforcement & Pressure Resistance
1076
+
1077
+ <div align="right"><a href="#top">back to top</a></div>
1078
+
1079
+ Open Agents includes a behavioral immune system that prevents the agent from making pattern-matched mistakes under pressure. Inspired by biological immune systems: constraints are the antibodies, pressure detection is the inflammatory response, and memory injection is the recall mechanism.
1080
+
1081
+ ### Constraint Enforcement (`.oa/constraints.json`)
1082
+
1083
+ Machine-readable rules checked **before every tool execution**:
1084
+
1085
+ ```json
1086
+ {
1087
+ "constraints": [
1088
+ {
1089
+ "id": "no-reward-hack",
1090
+ "trigger": "file_write|file_edit",
1091
+ "pattern": "NEVER say|ALWAYS say",
1092
+ "target_files": ["prompts/**/*.md"],
1093
+ "action": "warn",
1094
+ "message": "This looks like a reward-hacking directive. Fix the architecture, not the prompt."
1095
+ }
1096
+ ]
1097
+ }
1098
+ ```
1099
+
1100
+ | Action | Behavior |
1101
+ |--------|----------|
1102
+ | `block` | Prevents tool execution entirely, returns error to model |
1103
+ | `warn` | Executes tool but emits warning in agent's next turn context |
1104
+ | `log` | Silent recording to audit log, no interruption |
1105
+
1106
+ Constraints are scoped: global (`~/.open-agents/constraints.json`), project (`.oa/constraints.json`), or session (ephemeral).
1107
+
1108
+ ### Pressure-Aware Decision Gate
1109
+
1110
+ When the user is frustrated (detected via keyword matching), a brief `<reflection>` cue is injected into the agent's system prompt for ONE turn:
1111
+
1112
+ ```
1113
+ <reflection>The user is very frustrated. Pause. Check your constraints
1114
+ and past feedback before writing code. The fastest fix is often the wrong fix.</reflection>
1115
+ ```
1116
+
1117
+ This is NOT a block — it's a speed bump that prompts deliberation when the agent is most likely to cut corners. Zero overhead when no pressure is detected.
1118
+
1119
+ | Pressure Level | Detection | Response |
1120
+ |---------------|-----------|----------|
1121
+ | **none** | Normal messages | No cue (zero tokens) |
1122
+ | **moderate** | Frustration signals | "Verify your change addresses the root cause" |
1123
+ | **high** | Strong frustration + urgency | "Pause. Check constraints before acting" |
1124
+
1125
+ ### How It Works Together
1126
+
1127
+ ```
1128
+ User (frustrated): "fix this broken shit"
1129
+ → Pressure gate detects "high" → injects reflection cue
1130
+ → Model proposes file_edit on prompts/system.md with "NEVER say..."
1131
+ → Constraint checker matches "no-reward-hack" → emits warning
1132
+ → Model sees warning on next turn → reconsiders approach
1133
+ → Model fixes the architecture instead of adding a prompt hack
1134
+ ```
1135
+
1075
1136
  ## Context Compaction — Research-Backed Memory Management
1076
1137
 
1077
1138
  <div align="right"><a href="#top">back to top</a></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.186.6",
3
+ "version": "0.186.7",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",