how does it follow rules? #238
|
Without doing prompt engineering, how does griptape ensure that the passed rulesets are followed? I am facing several issues of the LLM (openai gpt3.5 turbo) not following the commands in the response, such as "as an ai language model" or "according to the provided context" using my own prompts (not using griptape), is there a technique griptape uses to ensure this consistency? |
Replies: 2 comments
|
@hyusetiawan You can take a look at how |
|
Rule following in agent frameworks is fundamentally a question of whether rules are enforced at the model layer (prompt injection) or at the execution layer (actual enforcement). Prompt-level rules ("you must always X") work until they don't — the model can be confused by complex contexts, long conversations that push the rule out of the context window, or adversarial inputs that cause the model to rationalize ignoring the rule. Execution-level rules are much stronger. A few approaches: Capability manifests enforced by the runtime — instead of telling the model "don't access the database," remove the database tool from the tool list entirely. The agent literally can't do what it's not given the capability to do. Validation middleware on tool calls — before any tool call is executed, run it through a policy checker: "does this action conform to the declared rules for this agent?" The policy check can be a separate, harder-to-corrupt system (not the same LLM that made the decision). Budget limits as hard constraints — "don't spend more than $0.50" enforced at the billing layer, not through the model. When the agent hits the ceiling, execution stops regardless of what the model says. Monotonic narrowing on delegation — when the agent spawns a sub-agent, the sub-agent can only inherit rules that the parent itself follows. No escalation of permissions through delegation. The key insight: rules that agents should follow should ideally not rely on the agent choosing to follow them — they should be enforced by the surrounding infrastructure. More on the capability and governance design: https://blog.kinthai.ai/openclaw-multi-tenancy-why-vm-per-user-doesnt-scale — and the audit/delegation layer: https://blog.kinthai.ai/221-agents-multi-agent-coordination-lessons Is the rule-following question for safety/safety boundaries, or for business logic constraints? |
@hyusetiawan You can take a look at how
Rulesets are inserted into the prompt through task templates. There is still prompt engineering going on here, but we try to abstract some of it away from the developer.