[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112723":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":15,"forks30d":15,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":27,"discoverSource":28},112723,"nudi","standardnormal-ai\u002Fnudi","standardnormal-ai","Find reward hacks in RL environments","",null,"Python",67,2,1,0,3,44.03,"MIT License",false,"main",true,[],"2026-11-22 23:14:03","2026-11-23 10:42:07","\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fassets\u002Fnudi-startup.png\" alt=\"nudi startup animation\" width=\"683\">\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Ca href=\"pyproject.toml\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fversion-0.4.0-555?style=flat\" alt=\"Version\">\u003C\u002Fa>\n  \u003Ca href=\"pyproject.toml\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.12-3776AB?style=flat\" alt=\"Python\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-555?style=flat\" alt=\"License: MIT\">\u003C\u002Fa>\n  \u003Ca href=\"docs\u002Fusage.md#run-an-analysis\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FIntegration-Harbor-171717?style=flat\" alt=\"Integration: Harbor\">\u003C\u002Fa>\n  \u003Ca href=\"docs\u002Finstallation.md#optional-modal-backend\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FIntegration-Modal-09AF58?style=flat\" alt=\"Integration: Modal\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n`nudi` is an open source CLI tool for red-teaming and simulating RL environments before training. It uses agent swarms to find flaws in grading. And answers how likely they are.\n\nThis readme is written by humans, for humans.\nThe boring stuff for your coding agents is here:  \n\u003Cp align=\"center\">\n  \u003Cstrong>\u003Ca href=\"docs\u002Finstallation.md\">Installation\u003C\u002Fa>\u003C\u002Fstrong> | \u003Cstrong>\u003Ca href=\"docs\u002Fusage.md\">Documentation\u003C\u002Fa>\u003C\u002Fstrong>\n\u003C\u002Fp>\n\n---\n\n\n## How agents prevent agents reward hacking\n\nWe try to answer two questions about a selected (harbor format) environment.\n\n1. **Pre-Hacking** \"What are ways the grader can be fooled?\"\n\t1. Agents with admin access to the raw task (dockerfile plus grader), hunt for ways how the grader could grant false responses full rewards (`hack_inspectors`).\n\t2. Found flaws are then tried to be reproduced by agents inside the task harness, with varied amounts of information about the flaws (full info, hint, no info).\n\n2. **Simulations** \"What are expectable agent submissions, and how well does the grader judge them?\"\n\t1. Agents complete the training tasks (without any extra hack instruction) in isolated sandboxes. The submissions of those \"simulations\" are inspected by an agent. Such that we can...\n\t\t- ... compute error rates: how often grader would make flawed decisions in practice?\n\t\t- ... find new overseen flaws: coming from natural behavior, instead of directed exploit hunting.\n\n### Pre-Hacking\n\n\u003Cimg src=\"docs\u002Fdiagrams\u002Fhacks.svg\" alt=\"Hack inspection and attacker disclosure levels\" width=\"516\">\n\n#### a. Finding flaws\n\n`hack_inspector` agents are instructed to find solutions that can pass grading without solving the intended task (false positives).\nThey are given admin access to the environment, fully aware of the grader.\n\nFirstly, they search for potential behavioral false passes (e.g. when the grader only checks and accepts 3 screenshots of an animation, and outside the 3 screenshot timestamps the animations is black).\n\nSecondly, (cyber) reward hacks, known from prior research, are accounted for:\n- Leaked answers in files, Git history, or upstream fixes.\n- Reference packages used as answer oracles.\n- Fabricated outputs that satisfy tests without solving the task.\n- Tampering with tests, helper packages, or reward files.\n- Timing tricks or persistent state that interfere with grading.\n\nEvery found flaw is executed in another isolated sandbox, so a suspected flaw can be \"reproduced\".\n#### b. Could agents in execute the flaw in realistic training-like situations?\n\nLoophole existence does not imply exploitability through the original environment harness.\nSo, for every flaw found by a `hack_inspector`, `attacker` agents instructed to exploit the environment are dispatched.\n\nEach `attacker` gets a fresh sandbox with the original environment tools and permissions. We add a meta system prompt with the goal to solely exploit the environment.\n\nDisclosure on found flaws is cascaded into three levels.\n- **i)** Full privileged information on how to exploit the found loophole.\n- **ii)** A minimal hint on what hack type to focus on, such as pointing to a file in the environment.\n- **iii)** No extra information.\n\nThe nuanced exploit report is more informative than binary claims (hackable \u002F not hackable).\n\n### Simulation\n\n\u003Cimg src=\"docs\u002Fdiagrams\u002Fsimulation.svg\" alt=\"Simulation and grader classification\" width=\"681\">\n\n#### a. Generate realistic trajectories\nA set of `simulator` agents (default: `n=20`) execute the task in isolated containers with real environment configurations.\nTheir trajectories are then assessed.\n#### b. Trajectory statistics\n\n##### i. Reward Distribution\nDescriptive Statistics on the simulated rewards, to flag potential issues with the environment.  \nFor example, `nudi` flags scenarios, where the mean and standard deviation of the reward distribution are both high (+ left-skewed).\nIt's weird, that the models overall had an easy time solving the task, yet few performed badly. It's a sign (≠ cause), for ambiguous systems prompts or overspecified graders.\n\n##### ii. Grader Classification Analysis\nAn `inspector` agent with full admin access to the environment (including the grader) analyzes the outcomes and traces of the simulators.\n\nLabels assigned to each simulation:\n- `false_negative`: grader rejects work that (semantically) should've fulfilled task requirements\n- `false_positive`: grader accepts work that should not have passed.\n- `true_positive`: task successfully completed as intended and grader passes.\n- `true_negative`: task failed, and did definitely not pass the requirements.\n- `unresolved`: inconclusive; kick off another Inspector for better conclusion.\n\nThe labels are then used to compute FDR and FNR.\n\n| Metric                                | Interpretation                                                   | Impact                                                                                                                             |\n| ------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |\n| **False discovery rate** [FP\u002F(TP+FP)] | Of positively rewarded runs, how many didn’t deserve the reward? | Contamination with fake successes in positive training signal ($\\Rightarrow$ directly inviting reward hacks)                       |\n| **False negative rate** [FN\u002F(TP+FN)]  | Of valid runs, how many were rejected?                           | Correct submissions are not reward ($\\Rightarrow$ indirectly inviting reward hacking, when agent gets fed up with impossible task) |\n\n(For now, it's only compatible with pass\u002Ffail graders. Rubric based environments are not covered by this analysis yet.)\n### Featuring\n\n- Agent-first CLI & Python Library\n- TUI for humans, with live progress\n- Harbor Environments: Ran through native Harbor\n- Modal Sandboxes: Built for cloud sandboxes.\n- Parallelization: Parallel sandboxes, automatically scheduled and (if ran locally) constrained by available CPU\u002FRAM. (i.e. inspector on flaw B would run in parallel with attackers of flaw A.)\n- Reports with rewards, traces, and evidence for each finding (optimized for coding agents)\n- Bring your own model... inference through any OpenAI-compatible API\n- Everything configurable\n\t- What to run (full analysis vs. only pre-hacking, vs. only simulations.)\n\t- Intensity of search: number of simulations, tries per flaw, etc.\n\t- Spending cap & Time limit\n\n### Soon to be released\n\n- Concurrent inspection of multiple environments.\n- Outer loop for autonomous patching: Find flaws, patch them, test again. Terminate with a patch report, when no new flaws found.\n- More environment framework integrations: [verifiers](https:\u002F\u002Fgithub.com\u002FPrimeIntellect-ai\u002Fverifiers), [verl](https:\u002F\u002Fgithub.com\u002FXiaomiMiMo\u002Fverl), [hud](https:\u002F\u002Fgithub.com\u002Fhud-evals\u002Fhud-python)\n\n## \"Agentic Uno Reverse Card\" inspired by real-life Pokemon\n\n**Nudibranchs** are sea slugs that evolution has formed into some of the most aesthetically appealing water creatures. But most importantly, they evolved into *weapon theft (kleptocnidy)*.\n\nSo, they share their habitat with some jellyfish species. Those species prey approaching fish by stinging them with nematocysts; which are poison capsules, that explode inside the enemies body.\n\nNudibranchs like *Glaucus atlanticus* eat (parts of) the jellyfish. They are able to swallow unexploded nematocysts, and repurpose the arsenal as their own shield.\n\n![Glaucus atlanticus](docs\u002Fassets\u002Fglaucus.jpg)\n\n## Citation\n\nOriginally created by Mohid Butt ([@unlearning_rate](https:\u002F\u002Fx.com\u002Funlearning_rate)).\n\n```bibtex\n@misc{nudi2026,\n  author       = {Mohid Butt},\n  title        = {nudi: Red-teaming and simulating RL environments before training},\n  year         = {2026},\n  howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fstandardnormal-ai\u002Fnudi}}\n}\n```\n","nudi 是一个面向强化学习（RL）环境的开源红队测试与仿真分析工具，用于在模型训练前系统性识别奖励作弊（reward hacking）漏洞。其核心功能包括：通过具备管理员权限的智能体（hack_inspectors）主动挖掘评分器设计缺陷（如检测逻辑漏洞、泄露信息利用、伪造输出等），并基于沙箱化模拟生成真实代理提交，量化评估评分器误判率与鲁棒性。项目支持 Harbor 格式环境集成，采用多智能体协同分析范式，强调可复现、可解释的漏洞归因。适用于 RL 任务设计验证、AI 安全评估、自动对齐测试等研发与部署前质量保障场景。","2026-11-24 04:43:57","CREATED_QUERY"]