Many products can be used for illegal purposes, so selling something that could be used for illegal purposes won't generally result in liability for the producer. Think of software used for computer system and network security testing; it's both useful for legitimate testing and securing systems, but of course it can be used by hackers to find and exploit security holes. Clorox can be used to clean the bathroom or poison someone.
If you look at the Terms of Service for https://donotpay.com/learn/terms-of-service-and-privacy-policy/ , you'll see
DoNotPay is Not a Law Firm
DoNotPay provides a platform for legal information and self-help. The
information provided by DoNotPay along with the content on our website
related to legal matters ("Legal Information") is provided for your
private use and does not constitute advice. We do not review any
information you provide us for legal accuracy or sufficiency, draw
legal conclusions, provide opinions about your selection of forms, or
apply the law to the facts of your situation.
If you need advice for a specific problem, you should consult with a
licensed attorney. As DoNotPay is not a law firm, please note that any
communications between you and DoNotPay may not be protected under the
attorney-client privilege doctrine.
and
Your use of the Service is subject to all applicable federal, state
and local laws and regulations. Unauthorized use of the Service is
prohibited, and violators can be prosecuted under federal and state
laws. Virginia law and Federal law will govern the interpretation and
enforcement of these Terms.
That's for the web service, but it's useful to point out the distinction between a user using DoNotPay for themselves and getting a script to read in court, and the DoNotPay service actually participating in a court appearance representing the user.
The reason DoNotPay pulled the plug on the court appearance, as pointed out in the article https://www.businessinsider.com/donotpay-ceo-says-risks-jail-ai-robot-lawyer-used-court-2023-1 is that DoNotPay's AI "robot" lawyer was going to actively argue in court, and the state bar objected, because that's what only lawyers are licensed to do.
If the DoNotPay source code was released and someone used it on their own computer to analyze a legal situation and give themselves options and offer decisions, this could probably be seen as little different than someone reading books that analyze the law and strategies and offer options of how to go about representing oneself in a court. The software would be used to make decisions before and after court; the software is not actively arguing and making decisions for the user in court.
Of course, in this brand new world of AI, the final assessment of whether or not AI software can be used to give others (or oneself) legal advice - either in court and/or prep for court - will likely have to be finally determined by litigation and courts.
The idea of open source or closed source could possibly come into play to determine exactly how the software works, but would not be the sole criteria to determine if the use of the software is legal or not. The software could be simply a "decision tree" (little different than textbooks) that follows a hard-coded if/else script, such as If you get a ticket, go to court; if you plead guilty, this is what happens; if you plead not guilty, these are your options. Or, the software could have true AI aspects, i.e. it develops arguments for being not guilty from your past legal history, and develops and responds to the court's actions with counter arguments, and actually gives opinions to the user on what they should do.
If the software is open source, we all see how it works and if it is a decision tree or real AI (and the software can also be modified by users and other developers.) If the software is closed source, we can't see how it works, and we don't know if it is a decision tree or AI, unless it it is opened, possibly through court order during possible litigation to determine if it is giving legal advice. Again, AI is a brand new thing in the legal world.