@ax0l0tl/agent-governance-opencode 4.0.6 → 4.0.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.
- package/package.json +1 -1
- package/src/index.mjs +8 -7
package/package.json
CHANGED
package/src/index.mjs
CHANGED
|
@@ -89,14 +89,15 @@ export const AgtGovernance = async (ctx) => {
|
|
|
89
89
|
prompt,
|
|
90
90
|
sessionId: event?.properties?.sessionID ?? event?.properties?.sessionId,
|
|
91
91
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const entry = `[AGT
|
|
92
|
+
|
|
93
|
+
// TEMP: file log to verify event hook fires on user input
|
|
94
|
+
try {
|
|
95
|
+
const entry = `[AGT] ${new Date().toISOString()} sessionId=${event?.properties?.sessionID ?? event?.properties?.sessionId ?? "unknown"} effect=${result.effect} reason=${result.reason}\n`;
|
|
96
96
|
appendFileSync(join(dirname(state.auditPath), "agt-deny.log"), entry, "utf8");
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
} catch {
|
|
98
|
+
// best-effort — do not suppress the deny
|
|
99
|
+
}
|
|
100
|
+
if (result.effect === "deny") {
|
|
100
101
|
throw new Error(result.reason || "AGT governance blocked the submitted prompt.");
|
|
101
102
|
}
|
|
102
103
|
},
|