Skip to content

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 16 Oct 14:41
91f5a22

Security release. It also publishes the agent test layer that was merged into main after v1.0.0 (launch profiles, bounded input trials, a persistent knowledge graph; pull requests #17 to #39).

Breaking for MCP clients that write. A client that changes a target (memory writes, breakpoints, patches, scripts, native calls, prompts) must now be started with cortex.exe mcp --allow-writes. A client that only saves Cortex's own records (project notes, addresses, pointer paths, knowledge, session facts, the cortex_test_* journals, catalog and reports) needs --allow-state, which cannot change the target; --allow-writes includes it. Clients that only observe and analyze are unaffected. See README.md and docs/mcp.md for the three configurations.

Security

The distributed v1.0.0 is affected: through mutation_permission (a boolean the client wrote itself), batch_run, cortex_attach and cortex/private/route, an AI client could change a target, or load the runtime into it, without the person having allowed writes. This was found by auditing the MCP path and reproduced against the real cortex.exe mcp. It is fixed as follows.

  • Write authority now comes from the person, not the model. cortex.exe mcp (and the cortex_host mcp bridge) take --allow-writes; without it every call that changes the target is refused with write_authority_required. The flag reaches the runtime on the authenticated pipe envelope, never inside a tool call. mutation_permission=true on the call is still required, as a declaration of intent, and no longer sufficient. The desktop supplies its own authority from the Read-only / Writes allowed switch. This is a behaviour change: an MCP client that wrote before must now be started with --allow-writes.
  • A narrower authority for Cortex's own records: --allow-state. Saving project notes, addresses, pointer paths, knowledge and facts (project_note_add, project_knowledge_put, re_session_fact_set, ...) and the test journals, catalog and reports (cortex_test_report, cortex_test_step_*, cortex_test_catalog_save, ...) is a new risk class, state. It needs mutation_permission and either --allow-state or --allow-writes, and is refused with state_authority_required otherwise. It cannot change the target: --allow-state alone still refuses every write to the target. Without it, an agent cannot plant records for a later session to read. A client that saved knowledge before must now be started with --allow-state.
  • batch_run no longer bypasses the permission. It was classed as an analysis although its ops write memory, freeze values and patch code. It is now classified from its operations against an allowlist, an unknown or computed operation is refused, and the same classification is re-checked after $from_step references are resolved so a reference cannot make an authorized step riskier.
  • cortex_attach (and --pid / --process) no longer inject without authority. Loading the runtime puts code in the target; without --allow-writes the server connects only to a runtime that is already there (for example loaded with cortex.exe inject <pid>).
  • The private desktop channel is closed to MCP clients. A raw cortex/private/route message sent by an MCP client was forwarded to the runtime, which ran any native route with no check. The server now forwards only initialize, ping, server/discover, tools/list, tools/call and notifications/*, and the runtime accepts a private route only from the desktop's own adapter.
  • scan_new / scan_next with pause_process, and all prompt_* tools, are now control operations that need authority.
  • A tool that no rule classifies is refused. Every listed tool now needs an explicit risk class; a tool with none is unclassified and is refused with tool_not_classified whatever authority the caller holds (before, an unknown name defaulted to analyze). tests/fixtures/mcp_tool_risks.json records the class of every primitive tool and a test fails if one changes or is missing.
  • Host tools added after v1.0.0 are classified. Every cortex_launch, cortex_test_* and cortex_knowledge_* tool is listed in tools/list as read_only or as host_control; the ones that send input, persist records or stop a trial also name an effect (target_input, cortex_state or trial). The regression test fails on a tool without a label, or with the wrong one. Launch, restart, stop, attach and input stay bounded by the operator-owned launch profile, and a launch profile that attaches the runtime grants no write authority.
  • Debugger attach and detach are journaled. The debug_* read tools stay available without write authority, because they do not write memory, but a debugger attached to a process suspends its threads. Each attach/detach is shown in the AI Activity tab and appended to cortex_debugger_events.jsonl.
  • Refused calls are logged to cortex_denied_mutations.jsonl (tool, arguments, UTC time, runtime or host), beside cortex_core.dll and cortex.exe, so attempts can be counted.
  • Regression test. tests/security_no_writes_regression.py starts the test target, loads the runtime beforehand, then calls every tool tools/list returns (251 on the --tools all profile), with plausible arguments and mutation_permission=true, against a server started without --allow-writes, and requires the target's code and data hash to be unchanged. Controls prove the hash does change when writes are allowed, and that --allow-state saves a note but still cannot write the target. It runs on x64 and x86 in CI.
  • Known limit, documented: the pipe token is a file readable by the same Windows user. A client that also has a shell or file access can read it and bypass these controls. An authority granted by the desktop for a limited time is planned.
  • Left as is, on purpose: cortex_operation_cancel and cortex_test_cancel need no authority (they only cancel something already authorized), and the debug_* read tools stay outside the control class: they write no memory, but a debugger attached to a process suspends its threads, which is why attach and detach are journaled.

Added

  • Launching and testing programs. The operator lists the programs an agent may start in a launch profile file (cortex.exe mcp --launch-config <file>); the agent selects a profile by name and cannot supply its own executable, arguments or working directory. cortex_launch_status, cortex_launch, cortex_restart and cortex_stop start, restart and stop the program, with run limits, one running child per profile, and optional attach of the runtime. See docs/automated-tests.md.
  • Bounded input trials. cortex_test_run posts allowlisted input to the launched program, reads values before and after, evaluates expectations (increased, unchanged, ...), waits on conditions, and writes JSON and Markdown reports under --test-results. cortex_test_get, cortex_test_list and cortex_test_cancel read and stop trials; cortex_test_compare compares repeatable trials. Input never uses SendInput; only the allowlisted program receives window messages.
  • Persistent typed knowledge graph. project_knowledge_put, project_knowledge_get, project_knowledge_list, project_knowledge_query, project_knowledge_verify and project_knowledge_graph keep claims, revisions and verifications in the project; cortex_knowledge_graph and cortex_knowledge_code_check read them and revalidate code references after a restart or a new generation of the program.
  • Evidence and code observations. cortex_test_link links a recorded trial to a knowledge record; cortex_test_code_context, cortex_test_code_candidates and cortex_test_code_link resolve the module and symbol of code observed during a trial (x64 PE unwind ranges included) and retain the location with the binary hash. cortex_test_evidence_graph shows the evidence behind a claim.
  • Investigations. Predictions are evaluated against what a trial observed; cortex_test_choose picks a discriminating next experiment; cortex_test_step_prepare, cortex_test_step_continue, cortex_test_step_record, cortex_test_step_next and cortex_test_step_get run it as a supervised step that survives a reconnection; cortex_test_generate and cortex_test_generate_prepare propose bounded experiments (experimental). cortex_test_report, cortex_test_report_get, cortex_test_investigation_report, cortex_test_investigation_summary, cortex_test_catalog_list and cortex_test_catalog_save keep the reports and a catalog of tested scenarios.
  • cortex_agent_guide returns the built-in guidance for an agent using these tools; AGENTS.md, agent/testing.md and agent/investigation-template.md document the workflow.
  • 37 tools in total (31 host tools and the 6 project_knowledge_* primitives): the --tools all profile now lists 251 tools and the compact profile 72.

Changed

  • Semantic tool results no longer carry confidence, evidence_confidence, candidates, alternative_hypotheses or tested_hypotheses. Cortex never computed them (confidence was a constant 1.0), and a figure that looks like a measure misleads the agent reading it. status is now documented as what it is: plan_ready, completed, failed, cancelled or timed_out.
  • The documentation and README no longer say that the application enforces writes for every call where that was only true of the desktop.

Fixed

  • debug_registers froze the target. ReadTargetThreadRegisters suspended a thread, read its context, then closed the thread handle before the guard that resumes it ran; ResumeThread on a closed handle fails, so the thread stayed suspended. Found by the new regression test; fixed by resuming explicitly before closing the handle.
  • cortex_test_run was listed as read_only. tools/list described the tool that sends keys and mouse clicks to the launched program as read-only. It is now host_control with effect: target_input and requires mutation_permission, like the other host tools that act. Only the label was wrong: the permission and the operator-owned launch profile were already enforced when the tool is called. The regression test now checks the label of five representative host tools.

Tests and CI

  • The five Windows workflows imgui-gui-tests, contracts, imgui-ui, unified-host and e2e-windows run on every pull request and on pushes to main, with no path filter, so a change outside the usual paths cannot skip them.
  • tests/fixtures/mcp_tool_risks.json freezes the risk class of every one of the 179 primitive tools; tests/mcp_authority_tests.cpp covers classification, the three authority levels and the denial log.
  • tests/test_runner_e2e.py arms hardware-write log breakpoints, so its main client is started with --allow-writes; a first client with --allow-state only asserts that a launch-profile attach cannot arm one.
  • publish-release.yml publishes when the commit message contains Release v1.0.1, so a merge commit whose pull request is titled that way publishes as well as a direct commit.