sofagent is an open-source FDE Harness positioned to govern between mature Agents (DSH / OpenClaw / WorkBuddy) and the model layer. Its core idea is: on entry, write business judgment into files (workflows, ontology data, AI nodes); after exit, audit every change against those files. It does not build Agents; what it delivers is the layer that keeps any Agent under control.
Main Capabilities
The constraint layer provides five capabilities: injection, auditing, retrospection, accumulation, and evolution. It includes 28 audit rules (secret leakage, out-of-bounds editing, injection defense, permission red lines, etc.), with violations intercepted on the spot; it supports fail-fast but by default is not fail-closed. It provides 104 MCP tools and 11 plugins, with the tool and capability surface covering evidence tiering. After auditing it automatically snapshots, supporting one-click return to any snapshot. AgentShield provides static scanning of five types of configuration surfaces. The audit history is written to an HMAC chain, and chain integrity can be recomputed offline via --verify-chain.
Usage
30-second zero-config trial: run in any git repository npx -y -p sofagent sofagent audit, to audit the most recent commit. If you only need the auditing CLI, you can install the scoped package:npm i -g @sofagent/audit. Five-minute sandbox demo:npx -y -p sofagent sofagent audit demo, running through the chain of "sandbox build → injection → deliberate violation → audit interception → snapshot rollback → HMAC evidence export". Full installation requires Node.js ≥ 18; download and review first, then execute; the installation script writes to ~/.sofagent/ and ~/.local/bin, and only writes platform integration directories when --platform is explicitly passed. The audit fallback is implemented via a git hook:sofagent audit --install-hook, with 17 rules enabled by default; the full 28 rules require enabling extendedRulesEnabled: true in .sofagent/config.yml. Multi-platform mounting is done via bash install.sh --platform <平台名> to select the tier.
Applicable Scenarios
Suitable for governance when enterprises introduce AI coding agents into their organizational structure: on entry, write job responsibilities into files; after exit, conduct performance reviews, organizational memory, and trial-and-error tolerance according to the files. Also suitable for development teams that want to constrain Agent behavior, audit every change, and accumulate experience.
Limitations
In the alpha construction period (v1.x), the feature surface changes rapidly, and interface stability is not promised; since v2.0.0 it has entered the beta stage. config.yml is not fail-closed by default, and rules can be tampered with and bypassed by the Agent; multi-tenant write-side isolation has not yet been implemented. Audit logs are by default stored in plaintext on disk; enterprise deployments are advised to enable static encryption. Currently designed for single-machine, single-user use. audit failures may be triggered by the A19 rule due to overly short commit messages (such as init/add). npm i -g sofagent brings a full dependency tree, containing 602 packages, of which 5 contain native modules; newer npm versions may silently skip compilation. The Dashboard is only provided with the full installation; direct npm installation does not include static assets. The decision layer (S1M) is scheduled for construction in v1.6.0–v1.9.0, announced in v2.0.0, and has not yet been delivered.