Secret agreements are fair only if they are shared
The glossary defines a convention as an understanding between partners about what their bids or plays mean, and says it is not unethical if the opponents are also informed. So what matters is whether the opponents know the code.
From Morehead and Mott-Smith, 1983, under 'Glossary'.