---
id: java-security
track: coding
version: 0.7.2
label: blocks
keyword: block
where: write turn-end
sha256: 228117950c4d4c0c0a2f2b95135df1ec1ca80f63fb89fa9831842ad9b3d316fa
source: https://github.com/open-coder-ai/chock-catalog/tree/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/base/java-security
catalog_ref: e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4
---

# Java Security Rules

java-security · version 0.7.2

Blocks — Blocks on an agent's file writes and at turn end. Chock adds friction. It is not a security boundary. 

In a git repo: at commit (Chock refuses the commit, locally and in CI.)



## What it does

Trigger: writing Java or Kotlin (Spring, Jakarta EE, Quarkus, Android), SQL/JPA/MyBatis, templates, application.properties/.yml, web.xml, pom.xml, Gradle; "customize java security" opens the guided page. avoid: injection, XXE, SSRF, unsafe deserialization, path traversal, weak crypto, trust-all TLS, Spring Security off, exposed secrets, known-exploited deps, SpotBugs/Sonar/PMD/Checkstyle findings. 129 rules, 16 packs, each allow|deny|ask in .chock/security.json; absent = deny (quality: allow). Not production-grade: try it under \`rollout: observe\` first.

## Its label on each agent

- Claude Code (tested): Blocks — Blocks on an agent's file writes and at turn end. Builder: /coding/builder/#client=claude-code&p=java-security
- Cursor (tested): Blocks — Blocks on an agent's file writes and at turn end. Builder: /coding/builder/#client=cursor&p=java-security
- Codex (tested): Blocks — Blocks on an agent's file writes and at turn end. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run). Builder: /coding/builder/#client=codex&p=java-security
- GitHub Copilot (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run). Builder: /coding/builder/#client=copilot&p=java-security
- Devin (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. If the hook errors, the action goes through (vendor docs only, not witnessed). Builder: /coding/builder/#client=devin&p=java-security
- Grok (tested): Not graded yet for Grok. Builder: /coding/builder/#client=grok&p=java-security
- goose (tested): Not graded yet for goose. Builder: /coding/builder/#client=goose&p=java-security
- Antigravity (tested): Not graded yet for Antigravity. Builder: /coding/builder/#client=antigravity&p=java-security
- OpenHands (untested): Not graded yet for OpenHands. Builder: /coding/builder/#client=openhands&p=java-security
- Kimi Code (untested): Not graded yet for Kimi Code. Builder: /coding/builder/#client=kimi-code&p=java-security
- Factory Droid (untested): Not graded yet for Factory Droid. Builder: /coding/builder/#client=factory-droid&p=java-security

## What it misses

This policy does not state what it misses.

## Examples

- Refused: A MyBatis mapper orders by a column taken from the request, written as ORDER BY ${col}.
- Allowed: A MyBatis mapper binds a parameter as WHERE id =

## Latest change

0.7.2 · 2026-11-17 — Description only (CAT-S1; review record discovery/2026-11-15-review-java-security.md): the label says this is a draft, to be tried under \`rollout: observe\` first. Status stays draft; no rule, script or eval changed.

## Provenance

- Tested by 167 of 177 cases run automatically
- SHA-256: `228117950c4d4c0c0a2f2b95135df1ec1ca80f63fb89fa9831842ad9b3d316fa`
- Catalog commit: https://github.com/open-coder-ai/chock-catalog/commit/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4
- Source: https://github.com/open-coder-ai/chock-catalog/tree/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/base/java-security (catalog path `base/java-security`)
- Presets: none
- JSON: `/api/coding/policies/java-security.json`
- Report a problem: https://chock.sh/report/?policy=java-security&version=0.7.2&page=%2Fcoding%2Fpolicies%2Fjava-security%2F
