Skip to content

fix: bound breach history + CostGuard thread safety (#247, #246)#253

Merged
imran-siddique merged 1 commit intomainfrom
fix/last-two-bugs
Mar 15, 2026
Merged

fix: bound breach history + CostGuard thread safety (#247, #246)#253
imran-siddique merged 1 commit intomainfrom
fix/last-two-bugs

Conversation

@imran-siddique
Copy link
Member

Fixes

Issue Fix
#247 RingBreachDetector._breach_history unbounded Changed to \deque(maxlen=10_000)\ with configurable \max_breach_history\
#246 CostGuard._org_spent_month race condition Added \ hreading.Lock\ protecting read-modify-write in \check_task()\ and \
ecord_cost()\

Tests: hypervisor 380 passed, cost 34 passed

Closes #247, closes #246

- RingBreachDetector: change _breach_history from unbounded list to
  deque(maxlen=10_000) with configurable max_breach_history (#247)
- CostGuard: add threading.Lock protecting _org_spent_month read-modify-
  write in check_task() and record_cost() (#246)

Closes #247, closes #246

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@imran-siddique imran-siddique merged commit 187f8cc into main Mar 15, 2026
45 checks passed
@github-actions github-actions bot added agent-hypervisor agent-hypervisor package agent-sre agent-sre package size/S Small PR (< 50 lines) labels Mar 15, 2026
@imran-siddique imran-siddique deleted the fix/last-two-bugs branch March 18, 2026 17:48
imran-siddique added a commit to imran-siddique/agent-governance-toolkit that referenced this pull request Mar 18, 2026
…CHANGELOG

Move CostGuard org kill bypass (microsoft#272), CostGuard thread safety (microsoft#253),
ErrorBudget unbounded deque (microsoft#172), and VectorClock race condition (microsoft#243)
from 'Fixed' to 'Security' section in v2.1.0 CHANGELOG — these are
security fixes affecting concurrent governance enforcement.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
imran-siddique added a commit to imran-siddique/agent-governance-toolkit that referenced this pull request Mar 18, 2026
…CHANGELOG

Move CostGuard org kill bypass (microsoft#272), CostGuard thread safety (microsoft#253),
ErrorBudget unbounded deque (microsoft#172), and VectorClock race condition (microsoft#243)
from 'Fixed' to 'Security' section in v2.1.0 CHANGELOG — these are
security fixes affecting concurrent governance enforcement.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
imran-siddique added a commit that referenced this pull request Mar 18, 2026
…ents (#296)

* fix(security): replace XOR placeholder with AES-256-GCM, add Security Model section

Address 3 findings from security review:

1. Replace insecure XOR placeholder encryption in DMZ module with
   real AES-256-GCM via cryptography library (was: 'NOT SECURE -
   placeholder only' comment in nexus/dmz.py)

2. Add 'Security Model & Limitations' section to root README making
   clear this is application-level middleware, not OS kernel isolation.
   Includes table of what each layer provides vs. does not provide.

3. Add checksum verification guidance to community preview disclaimer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(security): add demo warnings, adversarial mode, and security advisories

- Add in-memory storage warning to demo startup
- Add sample policy disclaimer to demo startup
- Add --include-attacks flag for adversarial demo scenarios
  (prompt injection, tool alias bypass, SQL policy bypass)
- Add security advisories to SECURITY.md for CostGuard org kill
  bypass (#272) and thread safety fixes (v2.1.0)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: relabel CostGuard and thread safety fixes as security items in CHANGELOG

Move CostGuard org kill bypass (#272), CostGuard thread safety (#253),
ErrorBudget unbounded deque (#172), and VectorClock race condition (#243)
from 'Fixed' to 'Security' section in v2.1.0 CHANGELOG — these are
security fixes affecting concurrent governance enforcement.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: address PR review feedback — docstrings, changelog, yaml safety

- Add docstring to scenario_adversarial_attacks
- Document --include-attacks flag in README
- Pin pyyaml version in security-scan workflow
- Audit and fix unsafe yaml.load() calls (if any)
- Add unreleased changelog entries

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-hypervisor agent-hypervisor package agent-sre agent-sre package size/S Small PR (< 50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(agent-hypervisor): bound RingBreachDetector._breach_history fix(agent-sre): add threading lock to CostGuard._org_spent_month

1 participant