Google Assistant in its current form does not offer users the capability to send a text directly from their Android phone's lockscreen, without unlocking the device. This can be perceived to be so due to security concerns that may crop up for said users if someone else gains access to their phones. However, it looks like Google may enable lockscreen texting in the future, as is indicated by a server-side A/B test spotted by 9to5Google.
Previously, attempting to send someone a text through Assistant without unlocking an Android device required the phone's passcode to be entered before the operation commenced. However, as can be observed in the image on the right, this can now be done without having to unlock said device. The lockscreen icon on the top indicates that the screen is currently locked. Assistant provides the usual confirmation once the text has been sent, exactly the same way in which a normal interaction with the service on unlocked phones occurs.
Notably, Google recently admitted that private audio data of its customers' interactions with Assistant were leaked. Given concerns surrounding this situation, and the fact that other tech giants like Amazon have also openly confessed to recording samples of their assistant services' voice recordings, it isn't too outlandish to assume that many people may now be reluctant to rely on these assistant applications.
Either way, the testing phase for the new feature seemingly coincides with the latest Google app beta update; however, it doesn't seem to have been rolled out on many devices as of now. As per 9to5Google, the feature is operational on Google Pixel 3 smartphones running Android Pie. However, the same handset running Android Q hasn't received the option for lockscreen texting yet, and the same goes for a tested Pixel 2 XL. As such, it's not clear whether a wider rollout is planned for lockscreen texting, but given that Assistant is part of the Google app, it can be safely assumed that it won't only be limited to Pixel devices.