How we keep AI agent actions under server side control in rails
ruby
dev.to
Here is an endpoint that looks fine in a first agent prototype. def create tool = params[:tool].constantize result = tool.call(**params[:arguments]) render json: result end The model returns a tool name and some arguments. Rails finds the class and runs it. It's short, and it works in a demo. It also gives the model the final say. If the agent reads a poisoned document, picks the wrong target or carries context over from another tenant, this endpoint runs the bad decision as it