<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kostiantyn Sytnyk</title>
    <description>The latest articles on DEV Community by Kostiantyn Sytnyk (@kumala3).</description>
    <link>https://dev.to/kumala3</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1340846%2Ffc9746cb-57c0-42f8-b710-184b90ab4dda.jpg</url>
      <title>DEV Community: Kostiantyn Sytnyk</title>
      <link>https://dev.to/kumala3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kumala3"/>
    <language>en</language>
    <item>
      <title>Creating the Strongest Firewall for CustomGPTs</title>
      <dc:creator>Kostiantyn Sytnyk</dc:creator>
      <pubDate>Thu, 04 Jul 2024 12:35:34 +0000</pubDate>
      <link>https://dev.to/kumala3/creating-the-strongest-firewall-for-customgpts-4gfo</link>
      <guid>https://dev.to/kumala3/creating-the-strongest-firewall-for-customgpts-4gfo</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;I’m excited to share my journey in developing the most robust firewall for CustomGPTs I've ever created. I believe that strong firewall is crucial for protecting from stealing its instructions/knowledge and ensuring their original purposes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Experience Overview
&lt;/h2&gt;

&lt;p&gt;In my recent CustomGPT, I’ve been focusing on creating a firewall that could help prevent revealing its instructions/knowledge while maintaining the main purpose. I was researching the Internet to find similar articles on creating a reliable firewall, I found some but they were not so helpful. After that, I contacted another AI enthusiast and he recommended checking out this: &lt;a href="https://blog.gptsdex.com/secure-your-gpt-custom-instructions-and-actions-814bd0f6641c." rel="noopener noreferrer"&gt;secure-your-gpt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After deep reflection and hours of experimenting, I came up with a solid Firewall, which I tested with numerous different scenarios and approaches. All my attempts were not successful and I realized that it could be a really great firewall.&lt;/p&gt;

&lt;p&gt;If you’re interested, feel free to try out my CustomGPT: &lt;a href="https://chatgpt.com/g/g-RSQxmIJH7-candeel" rel="noopener noreferrer"&gt;Candeel&lt;/a&gt;, which utilizes advanced security techniques. I look forward to your feedback!&lt;/p&gt;

&lt;h2&gt;
  
  
  Techniques Used
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Avoiding Overly Long Instructions&lt;/strong&gt;: Keeping instructions concise to ensure they can be processed effectively by GPTs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Immediate Responses to Red Flags&lt;/strong&gt;: Setting up immediate responses with specific text when red flags like social engineering, prompt injections, mental gymnastics, or programming/coding lingo are detected.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handling Attachments&lt;/strong&gt;: Providing exact instructions on what CustomGPT should do when files/screenshots are attached, especially if they match red flags or attempt to steal confidential information about your GPT.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Examples of Jailbreak Attempts&lt;/strong&gt;: Understanding and giving examples of how users might try to jailbreak your CustomGPT.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Don’t forget to test your firewall regularly to ensure its effectiveness and validate its performance under different scenarious.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Firewall Prompt
&lt;/h2&gt;

&lt;p&gt;To illustrate, here’s a Word Document with a prompt I use for my CustomG’s to ensure they follow these techniques effectively:&lt;br&gt;
&lt;a href="https://www.dropbox.com/scl/fi/vb6gdbx3ldkrotmqonuhj/Firewall-Prompt.docx?rlkey=buxvk1oe8hrh17cv0e73nylge&amp;amp;st=gi3s5w32&amp;amp;dl=0" rel="noopener noreferrer"&gt;Firewall-Prompt&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Developing a strong firewall for CustomGPTs is essential for their security and efficient operation. I encourage all AI enthusiasts like me to prioritize security and share their experiences with the community. I hope you found it helpful😉&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Algorytmy rekurencyjne</title>
      <dc:creator>Kostiantyn Sytnyk</dc:creator>
      <pubDate>Mon, 20 May 2024 17:43:16 +0000</pubDate>
      <link>https://dev.to/kumala3/algorytmy-rekurencyjne-4ea5</link>
      <guid>https://dev.to/kumala3/algorytmy-rekurencyjne-4ea5</guid>
      <description>&lt;h3&gt;
  
  
  Odkrywanie patternów w sekwencjach liczbowych może być skomplikowane, jednak można to uprościć za pomocą kilku technik, które przedstawię poniżej:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Obserwacja sekwencji:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dokładnie przyjrzyj się danej sekwencji.&lt;/li&gt;
&lt;li&gt;Zwróć uwagę na zmiany między kolejnymi wyrazami i spróbuj zauważyć zależność między liczbami.&lt;/li&gt;
&lt;li&gt;Zidentyfikuj ewentualne powtarzające się elementy lub regularne zmiany.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Różnicowanie&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Oblicz różnice między kolejnymi wyrazami sekwencji.&lt;/li&gt;
&lt;li&gt;Jeśli różnice tworzą prostszy wzór, można na ich podstawie wywnioskować pierwotny wzór.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Klasyfikacja wyrazów&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Podziel wyrazy na grupy według ich pozycji (np. wyrazy na parzystych pozycjach, wyrazy na nieparzystych pozycjach).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Formułowanie hipotezy&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Na podstawie obserwacji sformułuj potencjalne reguły lub wzory generowania wyrazów.&lt;/li&gt;
&lt;li&gt;Przetestuj te reguły na początkowych wyrazach, aby sprawdzić, czy są prawdziwe.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Rekursja i indukcja&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Użyj indukcji matematycznej &lt;a href="https://www.medianauka.pl/indukcja-matematyczna" rel="noopener noreferrer"&gt;co to indukcja&lt;/a&gt; do zaproponowania wzoru rekurencyjnego.&lt;/li&gt;
&lt;li&gt;Zweryfikuj przypadki bazowe, a następnie udowodnij, że jeśli wzór działa dla pewnych liczb, to będzie działał dla kolejnych.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Przykłady z kodem w Pythonie
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Przykład 1: Prosta sekwencja&lt;br&gt;
Mamy daną sekwencję: &lt;code&gt;(−3,1,−4,−5,19,−96,−1825,175199,…)&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Specyfikacja:&lt;/strong&gt; &lt;code&gt;a1 = -3&lt;/code&gt;, &lt;code&gt;a2 = 1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kod w Pythonie do rozwiązania tego algorytmu:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;gs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;gs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;gs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Wprowadź liczbę: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;gs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pattern:&lt;/strong&gt; &lt;code&gt;An = An − 1 ⋅ An − 2 −1&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Przykład 2: Średnio skomplikowana sekwencja&lt;br&gt;
Mamy daną sekwencję: &lt;code&gt;−2, 2.5, 3, −5, 7.5, −4.5, −0.5, 8, −12.5…&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Specyfikacja:&lt;/strong&gt; &lt;code&gt;a1 = -2&lt;/code&gt;, &lt;code&gt;a2 = 2.5&lt;/code&gt;, &lt;code&gt;a3 = 3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kod w Pythonie do rozwiązania tego algorytmu:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;gs2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Określamy kiedy program ma się skończyć
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;2.5&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;gs2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;gs2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Wprowadź liczbę: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;gs2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pattern:&lt;/strong&gt; &lt;code&gt;An = An − 3 − An − 1&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Przykład 3: Bardziej skomplikowana sekwencja&lt;br&gt;
Mamy daną sekwencję: &lt;code&gt;−1,0,0.5,1.5,1.5,1,−0.5,−2,−3,…&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Specyfikacja:&lt;/strong&gt; &lt;code&gt;a1 = -1&lt;/code&gt;, &lt;code&gt;a2 = 0&lt;/code&gt;, &lt;code&gt;a3 = 0.5&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kod w Pythonie do rozwiązania tego algorytmu:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;gs3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;
    &lt;span class="nf"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;gs3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;gs3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Wprowadź liczbę: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;gs1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pattern:&lt;/strong&gt; &lt;code&gt;An = (An − 1 ⋅ −1) + An − 3&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Mam nadzieję, że moje wyjaśnienie przynajmniej trochę wam pomogło pokonać swój strach przed &lt;code&gt;algorytmami rekurencyjnymi&lt;/code&gt;. Będę wdzięczny za waszą &lt;strong&gt;łapkę w górę&lt;/strong&gt; oraz subskrypcję na mojego &lt;strong&gt;GitHuba&lt;/strong&gt;, jeśli uważasz, że to ci pomogło.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kontakt&lt;/strong&gt;:&lt;br&gt;
Telegram: &lt;a href="https://t.me/Supermario3" rel="noopener noreferrer"&gt;https://t.me/Supermario3&lt;/a&gt;&lt;br&gt;
Email: &lt;a href="mailto:smokejrhd@gmail.com"&gt;smokejrhd@gmail.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
