We could do some validation on the supplied code when using the rain build --prompt command, and if we get failures, send the result back to the LLM before showing it to the user. The original request and the error could be worked into the Messages array as a conversation to try and get the model to improve its result. We would need to shell out to cfn-lint and cfn-guard to runs tests, which would require them to already be installed on the user's machine.
We could do some validation on the supplied code when using the
rain build --prompt
command, and if we get failures, send the result back to the LLM before showing it to the user. The original request and the error could be worked into the Messages array as a conversation to try and get the model to improve its result. We would need to shell out tocfn-lint
andcfn-guard
to runs tests, which would require them to already be installed on the user's machine.