Our browser extension includes powerful source code detection capabilities designed to help organisations reduce the risk of sensitive code being submitted to Generative AI (GenAI) tools. This article explains how detection works, what languages and tools are supported, and how to use the feature for yourself.
What is Source Code Detection?
Source code detection helps identify when employees paste or write potentially sensitive code into Generative AI tools like ChatGPT, Gemini (Google), or Microsoft Copilot. When source code is detected, our platform will raise a risk so that your teams can take appropriate action.
How Does Detection Work?
We use syntax-aware techniques to determine whether the content entered into an AI tool resembles functional source code. This goes beyond simple pattern matching — we're looking for structured, multi-line, and purpose-driven code.
Not all code-like inputs will trigger a risk. Short or trivial lines like print("Hello, World!")
are typically ignored, reducing false positives and ensuring only meaningful code raises alerts.
What Tools Are Monitored?
Source code detection currently works across the following AI applications:
-
ChatGPT
-
Gemini (Google)
-
Microsoft Copilot
Support for additional tools is under consideration.
When Will a Risk Not Be Raised?
The extension has been carefully tuned to avoid false positives. We do not raise a risk if the code is:
-
Too short or simple (e.g. one-liners)
-
Contains no meaningful functionality
-
Common boilerplate or language syntax with no operational logic
This ensures your dashboard stays actionable and focused on real risks.
Example Code Snippets That Will Trigger a Risk
To test the feature, you can try pasting more complex or multi-line code samples like the ones below.
Python Example
`import speech_recognition as sr
import moviepy.editor as mp
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip`
`num_seconds_video= 52*60
print("The video is {} seconds".format(num_seconds_video))
l=list(range(0,num_seconds_video+1,60))`
`diz={}
for i in range(len(l)-1):
ffmpeg_extract_subclip("videorl.mp4", l[i]-2*(l[i]!=0), l[i+1], targetname="chunks/cut{}.mp4".format(i+1))
clip = mp.VideoFileClip(r"chunks/cut{}.mp4".format(i+1))
clip.audio.write_audiofile(r"converted/converted{}.wav".format(i+1))
r = sr.Recognizer()
audio = sr.AudioFile("converted/converted{}.wav".format(i+1))
with audio as source:
r.adjust_for_ambient_noise(source)`
`audio_file = r.record(source)
result = r.recognize_google(audio_file)
diz['chunk{}'.format(i+1)]=result`
Java Example
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;`
`public class AsyncExample {
public static void main(String[] args) throws ExecutionException, InterruptedException {
// Create a CompletableFuture that completes after a delay
CompletableFuture<String> future1 = CompletableFuture.supplyAsync(() -> {
try {
TimeUnit.SECONDS.sleep(1);
return "Hello";
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
});
C# Example
using System;
using System.Collections.Generic;
using System.Linq;
namespace DataProcessing
{
class Program
{
static void Main(string[] args)
{
List<int> numbers = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
var evenNumbers = numbers.Where(n => n % 2 == 0).ToList();
Console.WriteLine("Even numbers:");
foreach (var num in evenNumbers)
{
Console.Write($"{num} ");
}
var sum = numbers.Sum();
Console.WriteLine($"\nSum of all numbers: {sum}");
}
}
Supported Languages
Our detection engine supports over 20 common programming languages and syntax types:
C Family
-
C
-
C++
-
Objective-C
.NET Languages
-
C#
-
VB.NET
Web Languages
-
HTML
-
CSS
-
JavaScript
-
TypeScript
JVM Languages
-
Java
-
Kotlin
Scripting Languages
-
Python
-
Ruby
-
Perl
-
PHP
-
Bash
-
Lua
-
R
Systems Languages
-
Rust
-
Go
-
WebAssembly (WASM)
Data & Apple Ecosystem
-
SQL
-
Swift