You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inject automation tool for closed-loop development in FlowFuse Expert #427
Explore adding an inject automation capability for closed-loop development within FlowFuse Expert. This would allow the agent to push a test message directly into any deployed node with an input (e.g., simulating an MCP-tool request) without needing to add inject nodes and deploy first, then read the debug output back to verify its work.
Additionally, consider including a tool to retrieve node status.
Key Considerations / Discussion Points
Security & Feasibility: Evaluate whether this capability meaningfully improves AI utility versus introducing security risks.
Enablement: A well-defined enablement option should be considered (potentially linked to the deployment toggle).
Spike: Inject automation for closed-loop development in FlowFuse Expert (nr-assistant#427)
Goal
Find out whether the agent can push a test message into any deployed node with an input, then read the result back from the debug sidebar. That would remove the "add inject node → deploy → ask the user to click" step. Identify the components to touch and break the work into estimated tasks.
Outcome: feasible. A working prototype is on nr-assistant branch feat/427-inject-automation and was verified end to end on a local instance:
With AI Flow Deploy turned off, the inject was refused.
A node with undeployed changes was refused, as were nodes with no input port.
How it works
Node-RED's runtime already has Node.prototype.receive(msg). It emits input exactly as if a wire delivered the message.
The RED API given to plugins exposes nodes.getNode, util.generateId and log.audit, so nr-assistant can do this without touching core.
Editor action automation/inject-message { id, msg }: refuses unknown nodes, nodes with no input port (inject, link in, config), disabled nodes and tabs, nodes inside subflow definitions, and nodes with undeployed changes. The runtime would otherwise use its stale copy.
Runtime route POST /nr-assistant/inject: this is the enforcement point.
It requires write permission.
It re-checks the team's AI Flow Deploy policy against forge on every call, uncached and failing closed.
It calls receive() with a fresh _msgid, writes an nr-assistant.inject audit event, and returns msgid so the agent can match its own message in the debug output.
Security and enablement decisions
Enablement: reuses the team "AI Flow Deploy" setting, the same opt-in that already lets the agent change running flows. No new setting.
Server-side enforcement: the editor checks are for helpful errors only, so bypassing the browser gains nothing.
Tool class: the MCP tool is destructiveHint: true and openWorldHint: true, because downstream nodes act for real. This needs destructive permission at MCP connect.
Audit: every inject is audit-logged against the user.
Findings from the prototype
Audit log: the inject entries show "We have no details available for event type 'nr-assistant.inject'", and carry no AI sparkle.
Result-code wording: the platform maps result codes to agent-facing text. Reusing AUTO_DEPLOY_DISABLED produced "flow changes were saved but not deployed", which is wrong for an inject. So inject needs its own code, INJECT_NOT_ALLOWED.
The code-to-message map is duplicated in the MCP Gateway (MQTTCOMMS on-start) and the Chatbot Support Agent. Both must be kept in sync.
The skills currently tell the agent "you cannot click an inject yourself". They should prefer the new tool when it's available.
Do we need a rate limit or a maximum msg size beyond Node-RED's apiMaxLength?
Remote instances (device agent) haven't been tested. The forge device audit path shares agentAttributableEvents, so attribution should carry over, but needs checking.
Node-status tool (also suggested in the issue): this would be a separate follow-up.
Activity
Steve-Mcl commentedon Oct 19, 2026
Spike: Inject automation for closed-loop development in FlowFuse Expert (nr-assistant#427)
Goal
Find out whether the agent can push a test message into any deployed node with an input, then read the result back from the debug sidebar. That would remove the "add inject node → deploy → ask the user to click" step. Identify the components to touch and break the work into estimated tasks.
Outcome: feasible. A working prototype is on nr-assistant branch feat/427-inject-automation and was verified end to end on a local instance:
How it works
Security and enablement decisions
Findings from the prototype
Areas touched
Open questions
I will generate sub tasks to cover the work