How to Develop Safely with AI

Generative AI is transforming software development. Large language models are good at human languages, but they’re even better at programming languages, which have much smaller vocabularies and fewer ways to combine words. Most importantly, code does something, so running it confirms whether it performs as intended.

The result has been a democratization of development, much as happened with desktop publishing. The Macintosh and PageMaker made it possible for almost anyone to produce a newsletter or brochure, but they did not turn every user into a professional designer, illustrator, or prepress specialist. AI can now produce working software for people who could never have written it themselves, but generating code is only part of building a reliable, trustworthy system.

Today, if you have a repetitive task that’s annoying to do but doesn’t warrant hiring a developer, you can use ChatGPT, Claude, or Gemini to help you create an AppleScript, shell script, Mac or iPhone app, or even a full-fledged Web app. However, if you’re going to dip your toe into AI-assisted development, you need to be careful. Professional developers know to watch out for numerous pitfalls, but if you’re using an AI, it’s up to you to make sure the AI takes them into account. Also, be aware that you’re still ultimately responsible for what you create with AI.

What Could Go Wrong?

In AI-powered development, there are two broad failure categories: problems with the development agent itself and problems with the finished product.

The AI world has moved past basic chatbots to agents that can look up information, change files, write and execute code, drive apps, and more. That makes them much more capable, but it also creates a situation where they could change or delete data, expose confidential data, or install software that itself creates a vulnerability.

On the other side of the equation is the finished product. If it’s local code, it could run but produce incorrect results, fill up a drive with data, overwrite important data, or cause crashes. A networked app could also generate excessive traffic, leak or expose confidential data, or serve as an entry point into your network.

Take AI Development in Steps

Professional developers aren’t born that way. They start with simple tasks and tackle more involved projects as they gain experience. With AI handling the programming for you, it can be tempting to take on a major app, but it’s safer to start with simple data analysis and local automation tools before moving on to full-fledged apps and networked systems. The process won’t turn you into a professional developer, but you’ll have a greater appreciation for all the things they have to consider.

Read-only Experiments

The best way to get started with AI development is with data analysis that would otherwise require you to build spreadsheet formulas, parse large CSV files, compare exported files, and the like. This may not seem like development, but when you drag the files into a chatbot conversation and ask it to work on them, you’ll notice that it does so by writing and executing one or more scripts, often in Python.

With this sort of AI work, you’re limited only by your data and your imagination. You could analyze an event registration or inventory spreadsheet to find trends, get a human-readable summary of errors in a massive log file, or compare data between two differently formatted CSV files to see which people appear in both.

The reason to start here is that you can easily detect errors, and nothing you do can change the data. Incorrect results may still look convincing, however, so compare them against known examples, verify totals, and spot-check the underlying records.

Local Automation Scripts

The next type of AI development to try is local automation via AppleScript or shell scripts. (If you’re uncertain how to execute a script, remember that you can always ask the AI for detailed instructions.) You could build customized scripts for batch-renaming files, creating future calendar events, manipulating images, and even reformatting HTML files.

However, because scripts can modify and delete data, you need to be more careful here. When possible, have the script create new output rather than modifying the original. Otherwise, work on a copy and ask the AI to:

  • Warn you about risks or ambiguities in your request
  • Preview exactly what it plans to change
  • Act only after you confirm the preview
  • Log what it changed
  • Record enough information to reverse its actions

Standalone Mac or iOS App

Apple’s App Store contains a vast number of apps, but it’s time-consuming to search for apps that promise to do what you want and test them to see if they actually do. All too often, they don’t.

With AI and Apple’s Xcode development environment, you can now create native apps for all your Apple devices. Needless to say, even setting up Xcode is complicated, but once again, an AI agent can do much of it for you and walk you through the rest of the steps. The hard part is often figuring out where some interface control is located, so don’t be shy about pasting a screenshot into the chat and saying, “I don’t see that control—where is it?”

The sky is the limit when it comes to developing your own apps for personal or internal use. You could create an injury rehab tracker, a publishing production checker, a custom document converter, a specialized camera app that adds metadata to photos, and more. Any workflow that’s awkward or doesn’t meet your needs is a candidate. Mac apps can be shared by copying; iPhone and iPad apps must go through Apple’s TestFlight. Again, ask for help.

When it comes to safety, as long as the apps are for personal or internal use, you mostly need to focus on app reliability and data integrity. Make sure to emphasize that the AI should build and run automated tests on every change, and when you’re testing, comment on anything that seems wrong—don’t settle. Specify that data integrity is paramount, require automatic backups, and allow for manual exports.

The bar gets much higher if you plan to distribute the app more widely. You’ll need to consider your obligations regarding support, compatibility, privacy, distribution, and long-term maintenance. An AI can help with some of those issues—be sure to ask it if there are any ways that user privacy could be abused, for instance—but the buck stops with you.

If you’re contemplating selling your app, you’ll also need to confirm that the licenses for any external code, images, fonts, and other components permit commercial distribution. Be extremely cautious if you plan to build a business around an app!

Networked Systems

With great power comes great responsibility. You must be much more careful with networked systems, especially if they’ll be accessible over the Internet. But it can be compelling to build such systems—you could make an equipment checkout system, an event registration system that goes beyond Google Forms, a shared inventory system, a document submission service, or a dashboard that aggregates live data from multiple services.

The problem is that the list of considerations goes well  beyond app reliability and data integrity, including these questions:

  • What data and operations must be protected? Some data may be confidential, and personally identifiable information is especially important to protect. Authentication credentials, API keys, and other secrets should never be embedded in source code, prompts, logs, or shared configuration files. Instead, store them in a system designed to manage secrets and limit who and what can access them.
  • Who may perform each action, and how is that enforced? Define user roles and limit each role’s permissions to only what is necessary. You don’t want a novice support representative accidentally deleting the database.
  • How do you contain hostile inputs and abusive use? Attackers will probe what happens when they submit malicious URLs, API requests, filenames, uploaded files, Web hooks, and other unexpected input. To reduce your exposure, validate all input, limit its size and complexity, and restrict how frequently users can trigger operations.
  • How do you separate development, testing, and production? Once you go live, it’s essential to separate these different environments so mistakes made during development don’t take down the live system and data generated during testing doesn’t contaminate the production database. Make sure to separate data and credentials as well.
  • How will the system handle simultaneous requests, retries, and partial failures? Network requests can arrive twice, overlap, or fail midway through multi-step operations. Work with the AI to prevent these sorts of issues, which can result in duplicate payments, registrations, messages, or inconsistent records.
  • How will you detect and contain attacks, outages, and unexpected behavior? Decide what to log, what conditions should trigger alerts, how access can be revoked, and if it’s possible to isolate a compromised component without shutting down the entire system.

Finally, assign an owner before putting any significant networked system into use. That person must be responsible for investigating failures, restoring data, updating dependencies, renewing credentials and certificates, responding to vulnerabilities, and eventually retiring the system. An internal application that nobody maintains may become less reliable and less secure with every operating-system update, expired credential, and newly discovered vulnerability.

(Featured image by iStock.com/Boonyakiat Chaloemchavalid)


Social Media: Thinking about using AI to write code? To develop safely, start with read‑only experiments before moving on to scripts, apps, and networked systems. Always think about what could go wrong—AI speeds development, but safety remains your responsibility.

Similar Posts

  • The airshow returns to Key West this weekend after a few years absence. It should be fun to go see the planes, the Blue Angels and other stunt pilots.

    We have gotten stock of the new 9.7-inch iPad Pro so stop into one of our stores if you want to get a hands-on look at the latest from Apple!

    Thank you for reading this issue of Kibbles & Bytes!

    Your Kibbles & Bytes Team,

    _Don, Emily & Hadley_

  • _Dear Friends,_

    Baseball season is almost upon us as spring training wraps up and the real games begin next week. The hopes for the Chicago Cubs have never been higher with a great line-up and pitching. Could this be our year? To help matters along, Apple and MLB announced this week that they have struck a multi-year deal to supply 12.9 inch iPad Pros with special STM team-logoed cases and a custom app called MLB Dugout. This app will help managers see performance statistics, check videos from games and analyze how pitchers and hitters are likely to perform against each other.

    Baseball has become a game of statistics and until this deal laptops, iPads and iPhones were banned from dugouts. That ban is gone as iPad Pros will replace the notebooks and photographs in big binders. Each team’s data will be downloaded to the iPads before the games. I can see this really speeding up the research about how to play a certain batter or what kind of stuff a pitcher has. Cubs manager, Joe Maddon, is not so sure “This might sound nuts to you, bit it might slow down the process. If there’s that moment that permits time to look up something, it might be OK, but I think thats where the piece of paper has it all over the computer–in that moment.” Well, Joe you are a hell of a manager but I’ll put the iPad Pro up against your binder any day! Fortunately, MLB didn’t ban paper so Joe is all set.

    I have talked many times about being a socially responsible business but this week we saw the power for good that businesses can use. While not yet successful in overturning the North Carolina law that legalizes discrimination against LGBT people, business pressure stopped a similar law in Georgia and the list of businesses lining up for repeal in NC is impressive. It was business that turned the tide when civil unions were first introduced in Vermont and it can be business again that dope-slaps some sense into these backwards legislatures, too.

    This week’s Kibbles & Bytes exclusive features the iPad mini 4 in Space Gray. This 64GB model features Wi-Fi and Cellular and comes with the AppleCare+ protection plan that increases the hardware warranty from 1 to 2 years, technical support from 90-days to 2-years and provides for accidental damage coverage. This is the latest iPad mini that features the Retina display. With 64GB of ram and cellular capability you will never be out of touch. Normally, this bundle is $730 but this week exclusively for Kibbles & Bytes readers you get the “**iPad mini 4 64GB Wi-Fi and Cellular with AppleCare+ for $50 off**”:http://www.smalldog.com/wag900002186 at “**$679.99!**”:http://www.smalldog.com/wag900002186/

  • _Dear Friends,_

    Vermont is back in the freezer as April becomes the most frustrating month for the Green Mountains. The days are longer, there is sun but it is too early to work in the garden. The roads are muddy and while the black flies haven’t awoken yet, it is hard to stay in the house but challenging to go outside.

    The iPad Pro 9.7-inch model has arrived at our stores and the initial sales have been strong. While this new iPad, at first glance, looks like the old iPad, once people start using it, playing with the Apple Pencil and realizing the advancements of this latest iPad they are hooked. Size-wise, I think that it might be ideal. The iPad Pro 12-inch model is, well it is big. The iPad mini is good for reading or checking your email abut the 9.7-inch iPad Pro is just right.

    I am very pleased to introduce the latest member of the Small Dog Team, Amy Farnsworth, who joins us as our Marketing and Design manager. Amy has strong marketing and graphic design background from her work in Utah and has recently relocated to Vermont with her husband. She says “I am a graphic designer, daydreamer, dog lover, wife, sister, best friend, Netflix junky & secret dad joke lover.” I think she will fit in fine! Please join me in welcoming Amy!

    This week’s Kibbles & Bytes exclusive features the Apple Certified Refurbished MacBook Pro. This is not a stripped down MacBook Pro but a fully-configured unit ready for your toughest challenges. It features the 2.8 GHz i7 intel processor, 16GB of ram, a 1TB hard drive and the NVIDIA 750M graphics chip driving the awesome “15-inch Retina display.”:http://www.smalldog.com/wag900002189 This Macbook Pro comes with the same 1-year warranty as new Macbook Pros but we are bundling it this week with Applecare that not only extends that 1-year warranty to 3-years but also extends your 90-days of free tech support from Apple to 3-years as well. “Kibbles & Bytes readers save $100 on this bundle at only $2925.98!”:http://www.smalldog.com/wag900002189

  • Why Every Business Needs an AI Policy

    Are employees at your company surreptitiously using artificial intelligence tools like ChatGPT, Claude, Copilot, and Gemini for everyday business tasks? It’s likely. An…