Skip to content

Transforms

Transforms handle cross-cutting request changes without copying that logic into every model. Declare only the capabilities the transform needs.

transform.ts
import { prependSystemPrompt } from "@neutrome/lil-engine";
import type { ProgramTransform } from "@neutrome/lilsdk";
const safetyPrompt: ProgramTransform = {
name: "safety-prompt",
capabilities: ["write_messages"],
apply(program) {
return prependSystemPrompt(program, "Do not reveal private data.");
},
};
export default safetyPrompt;

Create and save transforms in Compute → Transforms. Attach them to the routes that should receive the change, then deploy. Use the SDK reference for the ProgramTransform capability contract before writing transforms that edit tools, provider extensions, or content.