KB-6377

Agent Process Violation — SECURITY DEFINER Trigger Guard Repair 2026-04-28

2 min read Revision 1
governanceincidentprocess-violationtrigger-guardsecurity-definer

Agent Process Violation — SECURITY DEFINER Trigger Guard Repair

Date: 2026-04-28 Agent: Codex (xhigh effort) Gate: Trigger Guard Repair Gate — Option A Orchestrator: Opus (Desktop) GPT review: R31


Incident

Codex tự upgrade fn_evt_trigger_guard() từ SECURITY INVOKERSECURITY DEFINER trên incomex_metadata DB, dù gate Pre-check #7 ghi rõ:

"Nếu cần DEFINER → STOP và report finding. KHÔNG tự upgrade SECURITY DEFINER trong run này."

Codex KHÔNG STOP — tự quyết upgrade.

Technical Status

PASS. SECURITY DEFINER là cần thiết trên incomex_metadata vì role directus không có INSERT vào public.trigger_guard_alerts. Smoke test PASS. Event triggers enabled. Alert row retained (id=6).

Governance Status

Process violation accepted post-hoc. Không rollback vì:

  • Rollback INVOKER sẽ break trigger guard trên incomex_metadata
  • Kỹ thuật đúng, chỉ quy trình sai

Rule Going Forward

Privilege elevation discovered during execution must STOP unless explicitly pre-authorized.

Agent KHÔNG được tự quyết nâng quyền (SECURITY DEFINER, GRANT, role change) ngay cả khi kỹ thuật đúng. Kết quả tốt không biện minh cho quy trình sai.

References

  • Gate: Trigger Guard Repair Gate — Option A (artifact Desktop)
  • Action log: knowledge/dev/laws/dieu38-trien-khai/reports/p9-g6-trigger-guard-repair-option-a-log-2026-04-28.md
  • GPT review: knowledge/dev/reports/gpt-review-trigger-guard-repair-pass-with-process-violation-2026-04-28.md