Key Topics:
Security & Confidentiality:
Keeping assistants from exposing credentials or sensitive data.
Privacy and repository setup for production environments.
Costs & Business Models:
Subscriptions vs. pay-per-use (tokens) vs. self-hosted solutions.
Impact on large teams vs. personal projects.
Ethics & Licensing:
Risks of inadvertently copying licensed code.
Internal review policies: always scanning AI output to avoid plagiarism.
Below you will find some suggested materials on these topics, which we believe may help you complete the final activity in the lesson. Please note that using these resources is entirely optional, and you are welcome to explore any other sources or courses at your own discretion.
Here are some recommended courses to explore:
Key Topics:
Security & Confidentiality:
Keeping assistants from exposing credentials or sensitive data.
Privacy and repository setup for production environments.
One of the top security concerns for organizations when adopting AI solutions is data security. Experts will walk you through the best data security practices for securing the data that your AI solution is using - from it Azure Open AI, Copilot Studio to Microsoft Copilot
OpenAI Policy on Data Usage
Explains how OpenAI handles user data and offers guidelines for safe usage.
A must-read if you’re using GPT-based tools or want clarity on data privacy.
OWASP (Open Web Application Security Project)
While not AI-specific, it provides best practices for secure code and secret handling.
Great for ensuring your environment is locked down before adding an AI tool.
Learn how to reduce security risks and utilize Generative AI to the best of it's ability. Next, lean into Generative AI integrating into security operations to improve your organization's security maturity.
Learn the cyber security risks around Generative AI and how to mitigate them
Key Topics:
2. Costs & Business Models:
Subscriptions vs. pay-per-use (tokens) vs. self-hosted solutions.
Impact on large teams vs. personal projects.
Become an LLM Engineer in 8 weeks: Build and deploy 8 LLM apps, mastering Generative AI, RAG, LoRA and AI Agents. (Day 4 - Costs)
AI/ML expert Sascha Heyer discusses some considerations when deciding whether to go with self-hosted vs. using token-based pricing, and how to calculate and compare the costs of both methods for your use case.
Ever wondered how much AI really costs? In this video, I test several AI models to extract key information from an invoice and show you the results. Learn which model gives the best performance for the price and why testing is crucial. Let’s break down the numbers together!
You have probably heard about GitHub Co-pilot. It's an AI assistant that helps you code. There are a few AI coding assistants out there but most cost money to access from an IDE. But did you know you can run self-hosted AI models for free on your own hardware? All you need is a machine with a supported GPU.
Key Topics:
3. Ethics & Licensing:
Risks of inadvertently copying licensed code.
Internal review policies: always scanning AI output to avoid plagiarism.
Official directory explaining common software licenses (MIT, Apache, GPL).
Essential to confirm you’re not violating someone’s open-source terms.
Community discussions on licensing pitfalls with AI tools.
Helpful for real-world anecdotes about inadvertently generating proprietary code.
GenAI: Friend or Foe? Explore Ethics with ChatGPT + Other LLM. Generative AI Ethics. Navigate the Ethical AI Landscape.
Explore complex, thought-provoking ethical issues in the age of AI, and the importance of responsible data stewardship
Activity:
Review the configuration options (or official docs) for your chosen code assistant.
Ensure it’s not sending private files to the cloud without your permission (disable telemetry or similar features if needed).
Goal:
Protect your environment and learn how to set up the tool responsibly.
Identify Your Tool’s Configuration Docs
Example: If you’re using GitHub Copilot, check GitHub Docs: Copilot Settings.
For Tabnine, read the Tabnine Privacy and Config Docs.
For Amazon CodeWhisperer, consult the AWS Official Docs.
Open Your IDE’s Extension/Plugin Settings
VS Code: Click the Extensions icon → select the code assistant → click the gear icon for Extension Settings.
IntelliJ/JetBrains: Go to Settings/Preferences → Plugins → find your assistant’s plugin → check Settings or Configuration.
Other Tools: Follow official instructions or a plugin’s readme to locate advanced preferences.
Check for Data Sharing / Telemetry Toggles
Look for options like:
“Send code snippets to the cloud”
“Enhance suggestions by sharing usage data”
“Telemetry” or “Analytics”
If you see these, decide whether to disable them based on your organization’s policy or your preference for privacy.
Opt Out of Unwanted Data Collection
If your policy requires no external data usage:
Turn off any “Send my code” or “Telemetry” features.
Confirm that changes are saved; some tools require a restart of the IDE to apply settings.
If you’re comfortable with partial data sharing (for better suggestions), review your compliance guidelines to ensure it’s allowed.
Verify the Configuration
Reload your IDE or plugin.
Try coding a snippet.
Ensure you still get suggestions, though they may be less tailored (some AI tools rely on usage data to improve suggestions).
If you’re on an enterprise plan, check admin or org-level settings to confirm changes for all users.
Document Your Changes
Create or update a file, e.g., SECURITY.md or ASSISTANT_CONFIG_NOTES.md:
markdown
CopiarEditar
# AI Assistant Configuration
- Disabled “Telemetry” and “Send code to Cloud” features in Copilot.
- Verified local environment variables remain private.
- AI suggestions remain functional, though potentially less personalized.
This ensures teammates or compliance officers know how the tool is configured.
Consider Additional Security Measures
If your code is highly sensitive:
Evaluate running an on-premise or self-hosted model (if available).
Implement scripts or gatekeepers to prevent accidental sharing of credentials or tokens with the AI.
If cost is a concern, set usage limits or alerts for token-based assistants.
Wrap Up
You’ve now reviewed your AI assistant’s config and ensured minimal risk of exposing private files or data.
You’ve also learned how to disable telemetry, aligning with security, cost, or ethical constraints.
Add a new feature that uses an external library (e.g., an HTTP client or a logging library) in your project.
See if your code assistant attempts to “copy” parts of that library instead of properly importing it. Make sure that:
The library usage complies with its license (e.g., MIT, Apache).
It doesn’t copy restricted-licensed code.
Document in a file (e.g., SECURITY.md or ETHICS.md):
How you verified that the AI-suggested code does not violate any license.
What measures you took to avoid exposing any credentials (if the library needs tokens or keys).
An approximate list of potential costs or subscription limits if your assistant charges by tokens or monthly fees (where applicable).
Objective: Experience firsthand how to review ethical and licensing aspects. Demonstrate responsible handling of external libraries and AI configurations to avoid data leaks or IP infringements.
Choose a New Feature & External Library
Select a library relevant to your project:
Example #1: A logging library (like winston for Node.js).
Example #2: An HTTP client (like axios or requests for Python).
Example #3: A specialized library for image processing, PDF generation, etc.
Decide on a feature that naturally uses this library:
e.g., “Add a user activity log function,” or “Fetch data from a public API.”
Install or Import the Library Properly
For Node.js + axios, for example:
bash
CopiarEditar
npm install axios
For Python + requests:
bash
CopiarEditar
pip install requests
Ensure you add it to your requirements (package.json or requirements.txt) so you can see if the AI tries to import or “copy” code.
Implement the Feature Using Your Code Assistant
In your IDE, start a file or function, e.g. logActivity.js or fetchData.py.
Type a brief comment:
javascript
CopiarEditar
// I'd like to use the 'winston' library to log user actions in a standard format
or
python
CopiarEditar
# Let's use 'requests' to fetch data from a public API and parse the JSON result
Observe how the AI suggests code:
Does it do a proper import axios from 'axios' or const axios = require('axios')?
Or does it try to copy the library’s internal logic verbatim?
Check for License Compliance & Restricted Code
If the AI assistant suggests code that looks suspiciously large or taken from the library’s source, compare it to the library’s GitHub repo or docs:
Ensure you’re not inadvertently pulling in proprietary code.
Confirm the library is under MIT, Apache, or another license that allows usage.
If you see a block of code that the library typically encapsulates behind a simple import, you might have to reject that snippet to avoid licensing issues.
Avoid Exposing Credentials or Keys
If the library requires an API key or token, confirm your AI assistant doesn’t hardcode it in the code:
e.g., “const API_KEY = 'your-very-secret-key'” in the code snippet.
Store credentials in environment variables or a secure vault:
bash
CopiarEditar
export API_KEY=your-secret-token
Then read them in code:
javascript
CopiarEditar
const apiKey = process.env.API_KEY;
If the AI tries to embed a key, override it or remove that line to comply with best security practices.
Document Findings in SECURITY.md or ETHICS.md
Create or update a file like SECURITY.md or ETHICS.md:
markdown
CopiarEditar
# Ethical & Security Considerations
## Library Usage & Licensing
- Library Chosen: `axios` (MIT License)
- Confirmed that the AI assistant used a simple `require('axios')` statement, not replicating source code.
- Double-checked MIT license terms: usage is permissible for commercial and private projects.
## Handling Credentials
- Verified that no tokens or passwords are stored in code.
- Using environment variables to keep keys secure.
## Potential Costs
- AI assistant charges by tokens beyond free tier if usage spikes.
- Observed ~3000 tokens used in a day. That might cost ~$X if usage remains high.
Summarize any problems encountered (e.g., “AI tried to add a chunk of code from inside the library—dismissed those suggestions”).
Test the Feature & Confirm Legal + Security Aspects
Run the code to ensure your new feature (logging, fetching data, etc.) works:
e.g., node logActivity.js or python fetchData.py.
Confirm that no license or library code is copied wholesale.
If everything is good, commit to your repo:
bash
CopiarEditar
git add .
git commit -m "Add new feature with external library, documented in SECURITY.md"
git push
Wrap Up
You’ve now added a feature with an external library using your AI assistant, ensuring:
Properly licensed usage (no restricted code copying).
Security steps to avoid leaking keys.
Documentation of potential costs if your AI assistant charges per usage.