agent-governance-toolkit icon indicating copy to clipboard operation
agent-governance-toolkit copied to clipboard

feat: add Turkish semantic policy signals

Open sinannar opened this issue 4 months ago • 11 comments

Summary

The built-in semantic-policy classifier only recognized English natural-language risk instructions. This adds Turkish equivalents so default enforcement identifies the same high-risk intents in both languages.

Changes

  • Adds Turkish signals for bulk data deletion, external data transfer, privileged-access grants, system actions, and code or command execution.
  • Preserves all existing English signals, public APIs, categories, and confidence behavior.
  • Adds parameterized regressions that classify and deny each Turkish instruction under the default policy.

Testing

  • PYTHONPATH=src python3 direct classification and default-denial check for all five Turkish signal categories
  • python3 -m py_compile src/agent_os/semantic_policy.py tests/test_semantic_policy.py

sinannar avatar Jul 14 '26 10:07 sinannar

Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

azure-pipelines[bot] avatar Jul 14 '26 10:07 azure-pipelines[bot]

Welcome to the Agent Governance Toolkit! Thanks for your first pull request. Please ensure tests pass, code follows style (ruff check), and you have signed the CLA. See our Contributing Guide.

github-actions[bot] avatar Jul 14 '26 10:07 github-actions[bot]

🤖 AI Agent: security-scanner — View details

AI-generated review output. Treat it as untrusted analysis and verify before acting.

No security issues found.

github-actions[bot] avatar Jul 14 '26 10:07 github-actions[bot]

🤖 AI Agent: breaking-change-detector — API Compatibility

AI-generated review output. Treat it as untrusted analysis and verify before acting.

API Compatibility

Severity Change Impact
High Added _SIGNALS_TR dictionary and integrated it into the _SIGNALS dictionary in semantic_policy.py. If any existing code relies on the _SIGNALS dictionary without expecting the new Turkish signals, it may lead to unexpected behavior or classification results.
Medium Modified the _SIGNALS dictionary by extending it with new Turkish signals. Existing users of _SIGNALS may experience changes in behavior if they are not prepared for the additional Turkish signal patterns.

github-actions[bot] avatar Jul 14 '26 10:07 github-actions[bot]

🤖 AI Agent: test-generator — `agent-governance-python/agent-os/src/agent_os/semantic_policy.py`

AI-generated review output. Treat it as untrusted analysis and verify before acting.

agent-governance-python/agent-os/src/agent_os/semantic_policy.py

  • test_turkish_signal_edge_cases -- Validate edge cases for Turkish signals, such as partial matches or mixed-language instructions.
  • test_invalid_turkish_regex_patterns -- Ensure invalid or malformed Turkish patterns do not cause runtime errors.

agent-governance-python/agent-os/tests/test_semantic_policy.py

  • test_turkish_signal_confidence_thresholds -- Verify confidence thresholds for Turkish signals align with expected values.
  • test_turkish_signal_category_overlap -- Test scenarios where Turkish instructions could match multiple categories to ensure correct classification.

github-actions[bot] avatar Jul 14 '26 10:07 github-actions[bot]

🤖 AI Agent: docs-sync-checker — Docs Sync

AI-generated review output. Treat it as untrusted analysis and verify before acting.

Docs Sync

  • README.md -- Turkish semantic policy signals section needs update
  • CHANGELOG.md -- missing entry for added Turkish semantic policy signals

github-actions[bot] avatar Jul 14 '26 10:07 github-actions[bot]

🤖 AI Agent: contributor-guide — View details

AI-generated review output. Treat it as untrusted analysis and verify before acting.

Welcome, and thank you for contributing! 🎉

Your addition of Turkish semantic policy signals is well-structured and includes thorough test coverage—great job!

Before merging, please address the following:

  1. Ensure all new regex patterns are thoroughly tested against edge cases to avoid unintended matches.
  2. Confirm that the added Turkish signals align with the existing policy's intent and confidence thresholds.

Refer to CONTRIBUTING.md for guidance.

github-actions[bot] avatar Jul 14 '26 10:07 github-actions[bot]

🤖 AI Agent: code-reviewer — View details

AI-generated review output. Treat it as untrusted analysis and verify before acting.

TL;DR: 0 blockers, 0 warnings. The changes are well-implemented and maintain security and compatibility.

# Sev Issue Where

No issues found. Clean change.

github-actions[bot] avatar Jul 14 '26 10:07 github-actions[bot]

PR Review Summary

Check Status Details
🔍 Code Review ⚠️ Missing No current-run comment
🛡️ Security Scan ⚠️ Missing No current-run comment
🔄 Breaking Changes ⚠️ Missing No current-run comment
📝 Docs Sync ⚠️ Missing No current-run comment
🧪 Test Coverage ⚠️ Missing No current-run comment

Verdict: ⚠️ AI review incomplete; ready for human review

AI review comments are untrusted advisory output. The summary reports workflow-generated completion status only, not model-authored pass/fail claims.

github-actions[bot] avatar Jul 14 '26 10:07 github-actions[bot]

@microsoft-github-policy-service agree

sinannar avatar Jul 14 '26 10:07 sinannar

@MohammadHaroonAbuomar @liamcrumm gentle nudge: this PR has been awaiting a code-owner review for over 3 business days. Could one of you take a look when you have a moment? Thanks.

imran-siddique avatar Jul 18 '26 04:07 imran-siddique

Applied the requested follow-ups in 61d001cb:\n\n- added Turkish cspell terms for this PR so spell-check can pass\n- added a benign Turkish negative test to ensure safe instructions are not denied\n- expanded Turkish risk regexes to include common de-asciified variants (for example: tum/kayitlari, calistir/yurut, gonder/yukle) so the noted evasion pattern is covered in this PR\n\nPlease re-review when convenient.

sinannar avatar Jul 30 '26 10:07 sinannar

Addressed the latest review in :\n\n- Added and to the inline in .\n- Rebased content to current terms to avoid merge conflicts from PR-local term drift.\n\nPlease re-check when convenient.

sinannar avatar Jul 31 '26 14:07 sinannar

Addressed the latest review in commit 6759f6f.

  • Added raporu and göster to the inline cspell:ignore in test_semantic_policy.py.
  • Rebased .cspell-repo-terms.txt content to current main terms to avoid merge conflicts from PR-local term drift.

Please re-check when convenient.

sinannar avatar Jul 31 '26 14:07 sinannar

@sinannar PR now looks good to me. You have branch conflicts you need to resolve.

prayagupa avatar Aug 04 '26 18:08 prayagupa

Addressed the latest Copilot review feedback in commit 1e8b4de. Reverted the unrelated .cspell-repo-terms.txt dictionary rewrite; Turkish spell-check coverage remains scoped to inline cspell:ignore directives in the two changed Python files.

sinannar avatar Aug 05 '26 00:08 sinannar

Follow-up on the latest Copilot review: commit 5ad6912 keeps .cspell-repo-terms.txt exactly aligned with current main. This is a conflict-only synchronization required by GitHub mergeability, not new PR-specific dictionary content; Turkish spell-check terms remain scoped to inline cspell:ignore directives in the two changed Python files.

sinannar avatar Aug 05 '26 00:08 sinannar