Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

De-fork spike S3: HardPolicy kill gate (non-bypassable DDL denies at every dispatcher)

Open
#1,017 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
shell, sql, typescript
Domain
security, tooling

Research direction

Start by reading packages/opencode/src/altimate/policy/hard-policy.ts and the dispatcher locations named in session/prompt.ts, session/tools.ts, tool/batch.ts, and effect/app-runtime.ts. Run the 18-test bypass matrix; done means every listed dispatcher checks the post-hook final arguments, denies fail closed and terminally, and the audit oracle passes.

Written by the indexing model from the issue text.

Description

Stage S3 of the de-fork spike — the kill gate. Enforce non-bypassable hard denies (sql_execute DDL: DROP DATABASE/SCHEMA/TRUNCATE; bash DDL) at EVERY model-invoked tool-execution dispatcher, preserving today's behavior (these already block; S3 relocates them to one audited chokepoint).

  • NEW `packages/opencode/src/altimate/policy/hard-policy.ts` — pure/synchronous/total `HardPolicy.check()`; malformed args fail closed (policy_internal_error), never throws/implicit-allows. Emits a structured audit record per call (the oracle — NOT the trace).
  • HardPolicy.check inserted before tool.execute at all active + latent dispatchers (D1/D2/D6 in session/prompt.ts, D3/D4 in session/tools.ts, D5 in tool/batch.ts) + fail-closed init in effect/app-runtime.ts.
  • Fixes a real bypass: the fork's resolvers discarded `tool.execute.before`'s return value, so a before-hook that mutated args (SELECT -> DROP DATABASE) executed the mutation unchecked. S3 captures the post-hook FINAL args and checks THOSE.
  • 18 tests (bypass matrix): allow-all config still denies; near-miss controls run; deny is terminal (execute + tool.execute.after skipped); audit oracle asserted.

This is a security boundary + the spike's decision checkpoint. HELD for human go/no-go — do not auto-merge.

Dominant language
TypeScript
Stars
813
Forks
134
Avg merge
2d 3h
Merged PRs (30d)
65

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AltimateAI/altimate-code

All issues in AltimateAI/altimate-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.